octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #38746] Including mex.h does not work with G++


From: Clemens Buchacher
Subject: [Octave-bug-tracker] [bug #38746] Including mex.h does not work with G++ 4.8
Date: Tue, 21 May 2013 21:36:40 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31

Follow-up Comment #4, bug #38746 (project octave):

Below is a simple testcase with revision 16692:c19cc8c158b3 (this Saturday). 


$ cat <<EOF >mex_empty.cpp
#include "mex.h"
void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[])
{}
EOF
$  ~/.local/octave-dev/bin/mkoctfile --mex mex_empty.cpp
In file included from
/home/drizzd/.local/octave-dev/include/octave-3.7.5/octave/mexproto.h:52:0,
                 from
/home/drizzd/.local/octave-dev/include/octave-3.7.5/octave/mex.h:77,
                 from mex_empty.cpp:1:
/usr/include/c++/4.8.0/cstdlib: In function ‘long long int std::abs(long
long int)’:
/usr/include/c++/4.8.0/cstdlib:174:20: error: declaration of C function
‘long long int std::abs(long long int)’ conflicts with
   abs(long long __x) { return __builtin_llabs (__x); }
                    ^
/usr/include/c++/4.8.0/cstdlib:166:3: error: previous declaration ‘long int
std::abs(long int)’ here
   abs(long __i) { return __builtin_labs(__i); }
   ^
/usr/include/c++/4.8.0/cstdlib: In function ‘__int128
std::abs(__int128)’:
/usr/include/c++/4.8.0/cstdlib:179:19: error: declaration of C function
‘__int128 std::abs(__int128)’ conflicts with
   abs(__int128 __x) { return __x >= 0 ? __x : -__x; }
                   ^
/usr/include/c++/4.8.0/cstdlib:174:3: error: previous declaration ‘long long
int std::abs(long long int)’ here
   abs(long long __x) { return __builtin_llabs (__x); }
   ^
/usr/include/c++/4.8.0/cstdlib:179:19: error: declaration of C function
‘__int128 std::abs(__int128)’ conflicts with
   abs(__int128 __x) { return __x >= 0 ? __x : -__x; }
                   ^
/usr/include/c++/4.8.0/cstdlib:166:3: error: previous declaration ‘long int
std::abs(long int)’ here
   abs(long __i) { return __builtin_labs(__i); }
   ^


I get the same output with this:


$ g++ -save-temps -c
-I/home/drizzd/.local/octave-dev/include/octave-3.7.5/octave mex_empty.cpp


I am attaching mex_empty.ii and mex_empty.s from that command. I am also
attaching /usr/include/c++/4.8.0/cstdlib.

GCC Sources:
_snapshot=4.8-20130502
source=(ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-${_snapshot}.tar.bz2)

On my system GCC is built without patches, with the following flags:

CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector
--param=ssp-buffer-size=4"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector
--param=ssp-buffer-size=4"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
  # using -pipe causes spurious test-suite failures
  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
  CFLAGS=${CFLAGS/-pipe/}
  CXXFLAGS=${CXXFLAGS/-pipe/}

  ${srcdir}/${_basedir}/configure --prefix=/usr 
      --libdir=/usr/lib --libexecdir=/usr/lib 
      --mandir=/usr/share/man --infodir=/usr/share/info 
      --with-bugurl=https://bugs.archlinux.org/ 
      --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ 
      --enable-shared --enable-threads=posix 
      --with-system-zlib --enable-__cxa_atexit 
      --disable-libunwind-exceptions --enable-clocale=gnu 
      --disable-libstdcxx-pch 
      --enable-gnu-unique-object --enable-linker-build-id 
      --enable-cloog-backend=isl --disable-cloog-version-check 
      --enable-lto --enable-gold --enable-ld=default 
      --enable-plugin --with-plugin-ld=ld.gold 
      --with-linker-hash-style=gnu --disable-install-libiberty 
      --disable-multilib --disable-libssp --disable-werror 
      --enable-checking=release
  make

(file #28132, file #28133, file #28134)
    _______________________________________________________

Additional Item Attachment:

File name: mex_empty.s                    Size:0 KB
File name: cstdlib                        Size:6 KB
File name: mex_empty.ii                   Size:37 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?38746>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]