From help-octave-request at bevo dot che dot wisc dot edu Thu Sep 3 23:26:03 1998 Subject: compiling octave with egcs 1.1 ? From: "John W. Eaton" To: Cc: Date: Thu, 3 Sep 1998 23:26:36 -0500 (CDT) On 3-Sep-1998, Muzaffer Kal wrote: | has anyone done this ? Does it work ? I doubt that it will work for the 2.0.13 distribution without the patches that Mumit Khan posted to the bug-octave mailing list. You can get them from the mailing list archive on Octave web site at http://www.che.wisc.edu/octave/mailing-lists/bug-octave/1998/270. Even with the patches, you may have some trouble FWIW, I just picked up egcs-1.1a to try to compile Octave on a Linux system and and found the following problem. If anyone has a solution for this problem that is better than just redefining the W* macros in Octave's syswait.h include file, please let me know (or better yet, just post it to the bug-octave mailing list). The rest of this message is the text of the bug report I just sent in to egcs-bugs at cygnus dot com dot The following code compiles fine with the C compiler, but fails with the C++ compiler. void foobar (void) { int foo = 0; foo = __extension__ ({ union { __typeof (foo) __in; } __u; __u.__in = foo; }); } Here is the output from running g++ -v: Reading specs from /usr/local/egcs/1.1a/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/specs gcc version egcs-2.91.57 19980901 (egcs-1.1 release) /usr/local/egcs/1.1a/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ foo.cc /tmp/ccLSx5ek.ii GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (i386 Linux/ELF) #include "..." search starts here: #include <...> search starts here: /usr/local/egcs/1.1a/include/g++ /usr/local/include /usr/local/egcs/1.1a/i686-pc-linux-gnulibc1/include /usr/local/egcs/1.1a/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/include /usr/include End of search list. /usr/local/egcs/1.1a/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/cc1plus /tmp/ccLSx5ek.ii -quiet -dumpbase foo.cc -version -o /tmp/ccIAN1Ct.s GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release) (i686-pc-linux-gnulibc1) compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release). foo.cc: In function `void foobar()': foo.cc:7: `foo' undeclared (first use this function) foo.cc:7: (Each undeclared identifier is reported only once foo.cc:7: for each function it appears in.) foo.cc:7: warning: ANSI C++ forbids declaration `__in' with no type The code fragment above is what I came up with after expanding macros and simplifying code in Octave that looks like this: #include #include ... int status = 0; ... if (WIFEXITED (status)) status = WEXITSTATUS (status); ... and produces the same errors. I built egcs with configure --enable-shared --prefix=/usr/local/egcs/1.1a make bootstrap on a Linux 2.0.30 system with libc 5.4.33. jwe