* 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