http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54486

Marek Polacek <polacek at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |polacek at redhat dot com

--- Comment #1 from Marek Polacek <polacek at redhat dot com> 2012-09-05 
06:04:58 UTC ---
It is also needed to use -Wall.  Both arguments to strspn () are constants, so
in this case the __builtin_strspn () is used.  You shouldn't see this warning
with -fno-builtin-strspn.  Thus <string.h> is correct in this regard.

GCC 4.[1-5] are without warnings, with 4.6 I get:
/home/marek/rh/tests/pr54486.c: In function ‘main’:
/home/marek/rh/tests/pr54486.c:7:5: warning: format ‘%zu’ expects argument of
type ‘size_t’, but argument 2 has type ‘long unsigned int’ [-Wformat]
/home/marek/rh/tests/pr54486.c:8:5: warning: format ‘%zu’ expects argument of
type ‘size_t’, but argument 2 has type ‘long unsigned int’ [-Wformat]

with 4.7/trunk:
/home/marek/rh/tests/pr54486.c: In function ‘main’:
/home/marek/rh/tests/pr54486.c:7:5: warning: format ‘%zu’ expects argument of
type ‘size_t’, but argument 2 has type ‘sizetype’ [-Wformat]
/home/marek/rh/tests/pr54486.c:8:5: warning: format ‘%zu’ expects argument of
type ‘size_t’, but argument 2 has type ‘sizetype’ [-Wformat

Reply via email to