c-opts.c
37.1 KB
-
c-common.c (c_common_truthvalue_conversion): Generalise warning for addresses… · 690a704a
c-common.c (c_common_truthvalue_conversion): Generalise warning for addresses converted to booleans; not just function addresses. * 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. From-SVN: r108489
Ben Elliston committed