Skip to content
Snippets Groups Projects
  • Ben Elliston's avatar
    690a704a
    c-common.c (c_common_truthvalue_conversion): Generalise warning for addresses... · 690a704a
    Ben Elliston authored
    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
    690a704a
    History
    c-common.c (c_common_truthvalue_conversion): Generalise warning for addresses...
    Ben Elliston authored
    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