http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49462
Summary: comparison of const bool and pointer does not yield an error Product: gcc Version: 4.5.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: frederic.b...@m4x.org The following code should produce the error "ISO C++ forbids comparison between pointer and integer" when compiled with g++ -std=c++98 -pedantic-errors. When the bool is not const or volatile of const volatile, the error is produced. Only when bool is "only" const, the error is not produced. Same problem with all comparison operators ==, !=, <, <=, >, >=. int * pi=0; bool const b=0; pi==b; b==pi;