* c-common.c (c_common_truthvalue_conversion): Generalise warning
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Dec 2005 23:33:26 +0000 (23:33 +0000)
committerbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Dec 2005 23:33:26 +0000 (23:33 +0000)
commit90fea167ff11f5e72783ec456296dc4470a1a08a
treed72ae86b6320671af20df2fd5c12deb106455c3a
parentcd7a21ef35109620b88f28f9f59882d5917b9563
* c-common.c (c_common_truthvalue_conversion): Generalise warning
for addresses converted to booleans; not just function addresses.
* c-typeck.c (build_binary_op): Warn for address comparisons which
can never be NULL (eg. func == NULL or &var == NULL).
* common.opt (Walways-true): New option.
* c-opts.c (c_common_handle_option): Set it with -Wall.
* doc/invoke.texi: Document it.
testsuite/
* gcc.dg/warn-addr-cmp.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108489 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/c-common.c
gcc/c-opts.c
gcc/c-typeck.c
gcc/common.opt
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/warn-addr-cmp.c [new file with mode: 0644]