This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/54486] Spurious printf format warning mentions nonexistent type 'sizetype'


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]