Skip to content
Snippets Groups Projects
Commit 90fea167 authored by bje's avatar bje
Browse files

* 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
parent cd7a21ef
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment