http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55096
Bug #: 55096 Summary: Wconversion-nul does not work in C Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: m...@gcc.gnu.org From: http://blog.llvm.org/2011/05/c-at-google-here-be-dragons.html #include <stdbool.h> bool foo(void); bool * ProcessRequest(bool *charge_acct) { if (foo()) { charge_acct = false; } return charge_acct; } gcc -Wall -Wconversion -Wextra: silence :-( g++ test2.cc:5:17: warning: converting ‘false’ to pointer type ‘bool*’ [-Wconversion-null] charge_acct = false; ^ clang/clang++ test2.cc:5:19: warning: initialization of pointer of type 'bool *' to null from a constant boolean expression [-Wbool-conversion] charge_acct = false; ^~~~~