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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to