[LLVMbugs] [Bug 9043] New: -Waddress should produce some warnings
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Jan 24 17:43:54 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=9043
Summary: -Waddress should produce some warnings
Product: clang
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: matthewbg at google.com
CC: llvmbugs at cs.uiuc.edu
Here's some code that GCC warns on but Clang does not:
void f(bool b);
void g() {
int a[1];
f(a);
}
$ g++ -fsyntax-only -Waddress address-warn.cc
address-warn.cc: In function 'void g()':
address-warn.cc:4: warning: the address of 'a' will always evaluate as 'true'
$ clang -fsyntax-only -Waddress address-warn.cc
$
See r123864 and the ensuing r123866 for an example of this in the wild. See
also the GCC manpage for some other examples of constructs which GCC's
-Waddress catches.
--
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