Tue 21 Oct 2008 08:39:08 PM UTC, original submission:
I tried to compile a program with CGG waring options mentioned in Reference Manual A.4 GCC warning options for numerical programs, but GCC returned error as shown below.
gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -ansi -pedantic -Werror -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wtraditional -Wconversion -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wnested-externs -fshort-enums -fno-common -Dinline= -g -O4 -g -O2 -MT ***.o -MD -MP -MF .deps/**.Tpo -c -o **.o ***.c
In file included from /home/***/include/gsl/gsl_math.h:26,
from /home/***/include/gsl/gsl_fit.h:24,
from ****.c:5:
/home/***/include/gsl/gsl_nan.h:26:2: error: suggest not using #elif in traditional C
/home/***/include/gsl/gsl_nan.h:36:2: error: suggest not using #elif in traditional C
Removing -Wtraditional option, the compile was successfully compleated.
If these waring options is recomended officially, GSL itself ought not to block use of the options, I think.
The problematic part is like this.
#ifdef aaa
bbb
#elif ccc
ddd
#else
eee
#endif
This code can be switched to a code in below.
#ifdef aaa
bbb
#else
#ifdef ccc
ddd
#else
eee
#endif
#endif
I would like to take the modification into account.
|