This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/54486] Spurious printf format warning mentions nonexistent type 'sizetype'
- From: "polacek at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 05 Sep 2012 06:04:58 +0000
- Subject: [Bug c/54486] Spurious printf format warning mentions nonexistent type 'sizetype'
- Auto-submitted: auto-generated
- References: <bug-54486-4@http.gcc.gnu.org/bugzilla/>
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