From bug-octave-request at bevo dot che dot wisc dot edu Sun Feb 15 12:19:51 1998 Subject: Trouble compiling Octave 2.0.10, sighandlers.cc with gcc 2.8.0 From: "John W. Eaton" To: roberto at banach dot npt dot nuwc dot navy dot mil (Roberto Dominijanni) Cc: bug-octave at bevo dot che dot wisc dot edu Date: Sun, 15 Feb 1998 12:20:25 -0600 On 15-Feb-1998, Roberto Dominijanni wrote: | I've tried compiling Octave 2.0.10 under SunOS 4.1.3 using gcc 2.8.0 (with | CFLAGS=CXXFLAGS=-O3) and the latest f2c. Everything went well until | src/sighandlers.cc. The command | | c++ -c -I. -I.. -I../liboctave -I../src -I../glob -I../libcruft/misc -DHAVE_CONFIG_H -fno-rtti -fno-exceptions -fno-implicit-templates -O3 sighandlers.cc | | gave the following result: | | sighandlers.cc: In function `void my_friendly_exit(const char *, int)': | sighandlers.cc:114: passing `void (*)()' as argument 2 of `octave_set_signal_handler(int, void (*)(int))' ... | Any ideas on what it is about this file that is causing gcc to choke? >From the INSTALL.OCTAVE file: * If you encounter errors like passing `void (*)()' as argument 2 of `octave_set_signal_handler(int, void (*)(int))' or warning: ANSI C++ prohibits conversion from `(int)' to `(...)' while compiling `sighandlers.cc', you may need to edit some files in the `gcc' include subdirectory to add proper prototypes for functions there. For example, Ultrix 4.2 needs proper declarations for the `signal' function and the `SIG_IGN' macro in the file `signal.h'. On some systems the `SIG_IGN' macro is defined to be something like this: #define SIG_IGN (void (*)())1 when it should really be something like: #define SIG_IGN (void (*)(int))1 to match the prototype declaration for the `signal' function. This change should also be made for the `SIG_DFL' and `SIG_ERR' symbols. It may be necessary to change the definitions in `sys/signal.h' as well. The `gcc' `fixincludes' and `fixproto' scripts should probably fix these problems when `gcc' installs its modified set of header files, but I don't think that's been done yet. *You should not change the files in `/usr/include'*. You can find the `gcc' include directory tree by running the command gcc -print-libgcc-file-name The directory of `gcc' include files normally begins in the same directory that contains the file `libgcc.a'. jwe