Hello.

I just tried to compile Japhar on a Solaris Sparc
5.6 box with gcc, I got an interesting error
from gcc with the --enable-ansi to configure.


/bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../include 
-I/usr/dt/include -DWITH_MOTIF_AWT  -I/soft/X11R6.3/include -I../lib/libjni/include 
-I../lib/libjni/include -I../include -DLIBDIR=\"/tmp/mo/install_japhar/lib\"  -DDEBUG  
-g -O2 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations 
-Wreturn-type -Wcast-align -pedantic -ansi -c signals.c
gcc -DHAVE_CONFIG_H -I. -I. -I../include -I/usr/dt/include -DWITH_MOTIF_AWT 
-I/soft/X11R6.3/include -I../lib/libjni/include -I../lib/libjni/include -I../include 
-DLIBDIR=\"/tmp/mo/install_japhar/lib\" -DDEBUG -g -O2 -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wmissing-declarations -Wreturn-type -Wcast-align -pedantic -ansi 
-c -fPIC -DPIC signals.c
signals.c: In function `japhar_signal_handler':
signals.c:40: storage size of `sigact' isn't known
signals.c:43: warning: implicit declaration of function `sigemptyset'
signals.c:46: warning: implicit declaration of function `sigaction'
signals.c:40: warning: unused variable `sigact'
signals.c: In function `SIGNAL_install':
signals.c:60: storage size of `sigact' isn't known
signals.c:60: warning: unused variable `sigact'
make[1]: *** [signals.lo] Error 1
make[1]: Leaving directory `/tmp/mo/japhar-0.07/arch'




The problem seems to be the -ansi switch to gcc. I do not
know why but gcc refuses to compile some seemingly correct
code with the -ansi switch.

/* File sig.c */
#include <signal.h>

void foo() {
    struct sigaction sigact;
    sigaction(SIGBUS, &sigact, NULL);
}


% gcc -c sig.c


% gcc -ansi -c sig.c
sig.c: In function `foo':
sig.c:4: storage size of `sigact' isn't known
sig.c:5: `NULL' undeclared (first use this function)
sig.c:5: (Each undeclared identifier is reported only once
sig.c:5: for each function it appears in.)



I configured again without the -ansi switch and that fixed it.


later
Mo DeJong
dejong at cs.umn.edu

Reply via email to