This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/39044] -Wformat warns on printf() with stringpointer as sole argument
- From: "mano at roarinelk dot homelinux dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jan 2009 06:14:29 -0000
- Subject: [Bug c/39044] -Wformat warns on printf() with stringpointer as sole argument
- References: <bug-39044-14330@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from mano at roarinelk dot homelinux dot net 2009-01-31 06:14 -------
(In reply to comment #1)
> GNU C (GCC) version 4.3.3 20081218 (prerelease) [gcc-4_3-branch revision
> 142804] (i386-apple-darwin8.11.1)
>
>
> Did you modify GCC at all?
Ah, you're right. Gentoo enables -Wformat-security by default now. I'll bug
them about this.
On the other hand, this does not generate a warning. Why?
---- 8< ------- 8< --------
#include <stdio.h>
int main()
{
static const char *s = "hello", *t = " world";
printf(s, t);
return 0;
}
----- 8< ------ 8< ---------
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39044