[LLVMbugs] [Bug 8831] New: -Wformat-security: Cannot pass 0 as format-string
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Dec 20 03:19:51 PST 2010
http://llvm.org/bugs/show_bug.cgi?id=8831
Summary: -Wformat-security: Cannot pass 0 as format-string
Product: clang
Version: 2.8
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: akim.demaille at gmail.com
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=5912)
--> (http://llvm.org/bugs/attachment.cgi?id=5912)
C source file
In the following file, Clang makes a warning for something on which GCC does
not. Since there is a specific attribute to forbid null pointers as arguments,
it seems to me that the best behavior here is that of GCC.
clang -Wall format.cc -o foo -c
format.cc:7:12: warning: format string is not a string literal (potentially
insecure) [-Wformat-security]
myprintf(0);
^
1 warning generated.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list