http://llvm.org/bugs/show_bug.cgi?id=21124
Bug ID: 21124
Summary: G++'s __builtin___sprintf_chk() warns on more uses
than clang's
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Classification: Unclassified
G++ produces a warning for the following sample, whereas clang does not:
$ cat foo.cpp
int main() {
char buf[5];
__builtin___sprintf_chk(buf, 0, __builtin_object_size(buf, 0), "%s",
"foobar");
}
$ g++ foo.cpp
warning: call to int __builtin___sprintf_chk(char*, int, long unsigned int,
const char*, ...) will always overflow destination buffer [enabled by default]
__builtin___sprintf_chk(buf, 0, __builtin_object_size(buf, 0), "%s",
"foobar");
$ clang++ foo.cpp
$
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs