This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/10170] No warning for "if(foo)" instead of "if(foo())"
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jul 2003 23:28:14 -0000
- Subject: [Bug c/10170] No warning for "if(foo)" instead of "if(foo())"
- References: <20030320182600.10170.xkinh@yahoo.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10170
------- Additional Comments From gdr at integrable-solutions dot net 2003-07-18 23:28 -------
Subject: Re: No warning for "if(foo)" instead of "if(foo())"
"dhazeghi at yahoo dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| Still on mainline. I wouldn't mind a feature like this either...
I don't understand what you want the compiler to do with this.
If it a common idiom to write
if (foo)
do-something-with-foo(args);
especially with weak linkage. See Glibc source for example.
On the other hand it is also quite common to see codes like
if (ENABLE_CHECKING)
do-some-debug-mode-stuff
(where ENABLE_CHECKING is a constant expression either 0 ou 1).
Surely we don't want to ouput noise on those constructs.
I'm going to close this PR.
-- Gaby