I took a cvs update last night (24th) and it no longer builds!
It seems that the addition of the extra C flags has caused egcs
(2.91.66) and the include files (glibc 2.1.1) some grief.
As well as the warnings that have been present for a while,
I now get some more warnings, then a failure on canon.c:-
gcc -c -DHAVE_CONFIG_H -I. -I. -I../include -I../include -D_GNU_SOURCE
-DPATH_SANE_CONFIG_DIR=/etc/sane.d -DPATH_SANE_DATA_DIR=/usr/share/sane
-DV_MAJOR=1 -DV_MINOR=0 -O2 -m486 -fno-strength-reduce -W -Wall
-Dinline=__inline -ansi -pedantic -Wstrict-prototypes -Wreturn-type
-Wcast-align -Wpointer-arith -Wcast-qual -DSCSIBUFFERSIZE=131072
sanei_init_debug.c -fPIC -DPIC -o .libs/sanei_init_debug.lo
In file included from sanei_init_debug.c:52:
../include/sane/sanei_debug.h:45: warning: ANSI C does not allow macro
with variable arguments
sanei_init_debug.c: In function `sanei_init_debug':
sanei_init_debug.c:71: warning: ANSI C forbids braced-groups within
expressions
gcc -c -DHAVE_CONFIG_H -I. -I. -I../include -I../include -D_GNU_SOURCE
-DPATH_SANE_CONFIG_DIR=/etc/sane.d -DPATH_SANE_DATA_DIR=/usr/share/sane
-DV_MAJOR=1 -DV_MINOR=0 -O2 -m486 -fno-strength-reduce -W -Wall
-Dinline=__inline -ansi -pedantic -Wstrict-prototypes -Wreturn-type
-Wcast-align -Wpointer-arith -Wcast-qual -DSCSIBUFFERSIZE=131072
sanei_codec_ascii.c -fPIC -DPIC -o .libs/sanei_codec_ascii.lo
sanei_codec_ascii.c: In function `get_digit':
sanei_codec_ascii.c:76: warning: ANSI C forbids braced-groups within
expressions
gcc -c -DHAVE_CONFIG_H -I. -I. -I../include -I../include -D_GNU_SOURCE
-DPATH_SANE_CONFIG_DIR=/etc/sane.d -DPATH_SANE_DATA_DIR=/usr/share/sane
-DV_MAJOR=1 -DV_MINOR=0 -O2 -m486 -fno-strength-reduce -W -Wall
-Dinline=__inline -ansi -pedantic -Wstrict-prototypes -Wreturn-type
-Wcast-align -Wpointer-arith -Wcast-qual -DSCSIBUFFERSIZE=131072
sanei_pio.c -fPIC -DPIC -o .libs/sanei_pio.lo
In file included from ../include/sane/sanei_backend.h:1,
from sanei_pio.c:55:
../include/sane/sanei_debug.h:45: warning: ANSI C does not allow macro
with variable arguments
In file included from /usr/include/fcntl.h:33,
from sanei_pio.c:95:
/usr/include/bits/fcntl.h:38: warning: `O_NONBLOCK' redefined
../include/sane/sanei_backend.h:15: warning: this is the location of
the previous definition
(now the big failure...)
gcc -c -O2 -m486 -fno-strength-reduce -W -Wall -Dinline=__inline -ansi
-pedantic -Wstrict-prototypes -Wreturn-type -Wcast-align -Wpointer-arith
-Wcast-qual -DSCSIBUFFERSIZE=131072 -DHAVE_CONFIG_H -I. -I. -I../include
-I../include -D_GNU_SOURCE -DPATH_SANE_CONFIG_DIR=/etc/sane.d
-DPATH_SANE_DATA_DIR=/usr/share/sane -DV_MAJOR=1 -DV_MINOR=0
-DBACKEND_NAME=canon -DLIBDIR=/usr/lib/sane canon.c -fPIC -DPIC -o
.libs/canon.lo
In file included from ../include/sane/sanei_backend.h:1,
from canon.c:105:
../include/sane/sanei_debug.h:45: warning: ANSI C does not allow macro
with
variable arguments
/usr/include/bits/mathinline.h: In function `__signbitf':
In file included from /usr/include/math.h:348,
from canon.c:97:
/usr/include/bits/mathinline.h:117: warning: ANSI C forbids specifying
structure member to initialize
/usr/include/bits/mathinline.h:117: initializer element for `__u.__f' is
not computable at load time
/usr/include/bits/mathinline.h: In function `__signbit':
/usr/include/bits/mathinline.h:122: warning: ANSI C forbids specifying
structure member to initialize
/usr/include/bits/mathinline.h:122: initializer element for `__u.__d' is
not computable at load time
/usr/include/bits/mathinline.h: In function `__signbitl':
/usr/include/bits/mathinline.h:127: warning: ANSI C forbids specifying
structure member to initialize
/usr/include/bits/mathinline.h:127: initializer element for `__u.__l' is
not computable at load time
make[1]: *** [canon.lo] Error 1
make[1]: Leaving directory
`/usr/src/redhat/BUILD/sane-1.0.1.20000224/backend'
make: *** [all-recursive] Error 1
I took off the "-Dinline=__inline" part of the C flags but that didn't
fix it (incidentally, configure explicitly checks for "inline" and
writes the define into include/sane/config.h, on my system it is
"#define inline __inline_" if you use "-ansi", but see below).
Taking the "-pedantic" off removes all the warnings about ANSI C and
also allows canon.c to compile!
Looking further, one of the first things that "configure" does is
to see what flags have to be added to cc to get ansi mode, in my
case it comes up with "none", so the "-ansi" bit is not needed
either! In fact, it says in configure:-
--quote
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
--end quote
It looks like RedHat 6 is one of those - it has problems with the
"mathinline.h" file.
For interest's sake, the lines that cause the problems are:-
__MATH_INLINE int
__signbitf (float __x)
union { float __f; int __i; } __u = { __f: __x }; return __u.__i < 0;
__MATH_INLINE int
__signbit (double __x)
union { double __d; int __i[2]; } __u = { __d: __x }; return
__u.__i[1] < 0;
__MATH_INLINE int
__signbitl (long double __x)
union { long double __l; int __i[3]; } __u = { __l: __x };
return (__u.__i[2] & 0x8000) != 0;
I think the phrase that springs to mind is "can of worms".
Dave Hill
-- Dave Hill, Kempston, Bedford UK dave@minnie.demon.co.uk Sicth munce ago, I cutn't evun spel enjuneer, and now I are one!-- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
This archive was generated by hypermail 2b29 : Fri Feb 25 2000 - 11:25:17 PST