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/39044] -Wformat warns on printf() with stringpointer as sole argument



------- 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


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