[cfe-commits] r126447 - in /cfe/trunk:	lib/Sema/SemaChecking.cpp	test/Sema/format-strings.c
    Chris Lattner 
    clattner at apple.com
       
    Thu Feb 24 17:04:35 PST 2011
    
    
  
On Feb 24, 2011, at 4:11 PM, Eli Friedman wrote:
> On Thu, Feb 24, 2011 at 3:03 PM, Ted Kremenek <kremenek at apple.com> wrote:
>> Author: kremenek
>> Date: Thu Feb 24 17:03:04 2011
>> New Revision: 126447
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=126447&view=rev
>> Log:
>> Don't warn about using PredefinedExprs as format string literals.  These never can be a real security issue.
> 
> #include <cstdio>
> const int a=0, d=1;
> void f(__typeof(a%d)) { printf(__PRETTY_FUNCTION__); puts(""); }
> int main() { f(0); return 0; }
> 
> Generated output:
> void f(typeof (a -1465849624))
Ok, it's possible (and very clever).  I don't think it's sufficiently worth worrying about though :)
-Chris
    
    
More information about the cfe-commits
mailing list