This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/45278] New: -Wextra doesn't warn about (pointer < 0 ).


$ cat ptr.cpp
extern void* p;
int main() { return ( p<0 ? 1 : 0 ); }

$ g++ ptr.cpp -Wall -Wextra -O2 -S -fdump-tree-optimized

int main() ()
{
<bb 2>:
  return 0;
}

gcc manual:

"The option -Wextra also prints warning messages for the following cases:
 &#183; A pointer is compared against integer zero with <, <=, >, or >=."


so, this looks like a missed-diagnostics.


-- 
           Summary: -Wextra doesn't warn about (pointer < 0 ).
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
 GCC build triplet: x86_64-gnu-linux
  GCC host triplet: x86_64-gnu-linux
GCC target triplet: x86_64-gnu-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45278


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]