[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    [cfe-dev] Bogus warning
From:       kremenek () apple ! com (Ted Kremenek)
Date:       2007-12-18 18:48:34
Message-ID: D0E3D20E-C2C1-4D0D-BA90-2CEE7AFAB964 () apple ! com
[Download RAW message or body]

This is a false positive.  Thanks for pointing it out!  I will add it  
to my queue of things to fix/improve.

On Dec 18, 2007, at 12:38 AM, Nico Weber wrote:

> Hi,
>
> this looks like a bug:
>
> s0539:src nico$ cat test.c
> #include "stdio.h"
>
> int main() {
>   char buf[1];
>   sprintf(buf, 1 ? "" : "");
> }
> s0539:src nico$ ./clang test.c
> running "/Users/nico/src/llvm-svn/Debug/bin/clang -fsyntax-only  
> test.c"
> test.c:5:16: warning: format string is not a string literal
> (potentially insecure)
>   sprintf(buf, 1 ? "" : "");
>   ~~~~~~~      ^
> 1 diagnostic generated.
>
> Nico
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic