[SLE] Unwelcome warnings from include files
Hello. While compiling some `getopt.c' using SuSE 6.4 (gcc), I see: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I../../lib -I.. -I.. -I../../lib -pedantic -Wall -Wtraditional -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wwrite-strings -Wnested-externs -g -O2 -c ../../lib/getopt.c In file included from /usr/include/string.h:346, from ../../lib/error.c:45: /usr/include/bits/string2.h: In function `__strcpy_small': /usr/include/bits/string2.h:419: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:427: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:432: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:437: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:439: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:444: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h: In function `__strsep_g': /usr/include/bits/string2.h:1171: warning: passing arg 2 of `__strpbrk_c2' with different width due to prototype /usr/include/bits/string2.h:1171: warning: passing arg 3 of `__strpbrk_c2' with different width due to prototype /usr/include/bits/string2.h:1171: warning: passing arg 2 of `__strpbrk_c3' with different width due to prototype /usr/include/bits/string2.h:1171: warning: passing arg 3 of `__strpbrk_c3' with different width due to prototype /usr/include/bits/string2.h:1171: warning: passing arg 4 of `__strpbrk_c3' with different width due to prototype I do try to keep my own sources "warning-clean", and would be tempted to hope that system include files share this quality as well. Is my hope reasonable? -- François Pinard http://www.iro.umontreal.ca/~pinard -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
* François Pinard (pinard@iro.umontreal.ca) [20000627 02:22]:
/usr/bin/gcc -DHAVE_CONFIG_H -I. -I../../lib -I.. -I.. -I../../lib -pedantic -Wall -Wtraditional -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wwrite-strings -Wnested-externs -g -O2 -c ../../lib/getopt.c In file included from /usr/include/string.h:346, from ../../lib/error.c:45: /usr/include/bits/string2.h: In function `__strcpy_small': /usr/include/bits/string2.h:419: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:427: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:432: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:437: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:439: warning: pointer of type `void *' used in arithmetic /usr/include/bits/string2.h:444: warning: pointer of type `void *' used in arithmetic
This is a bug in gcc 2.95.2, in that it ignores the fact that the code in question is inside __extension__ blocks, which should shut it up. This is fixed in the gcc 2.95.2 for 7.0. If you want the patch, just send me a mail.
/usr/include/bits/string2.h: In function `__strsep_g': /usr/include/bits/string2.h:1171: warning: passing arg 2 of `__strpbrk_c2' with different width due to prototype
Seems to be another gcc bug. If you look at /usr/include/bits/string2.h, you'll find it gets passed a char and the prototype also has char as type, so it's not clear to me why it's complaining.
I do try to keep my own sources "warning-clean", and would be tempted to hope that system include files share this quality as well. Is my hope reasonable?
To a point yes, but it looks like the bug is in gcc, not the headers, at least the void * issue. For the __strsep_g issue you might like to ask on libc-alpha@sourceware.cygnus.com . BTW, IMHO -Wconversion is of limited use, as you'll get warnings for valid code. Philipp -- Philipp Thomas <pthomas@suse.de> Development, SuSE GmbH, Schanzaecker Str. 10, D-90443 Nuremberg, Germany #define NINODE 50 /* number of in core inodes */ #define NPROC 30 /* max number of processes */ -- Version 7 UNIX for PDP 11, /usr/include/sys/param.h -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (2)
-
pinard@iro.umontreal.ca
-
pthomas@suse.de