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: "neil at daikokuya dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2003 16:07:37 -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 neil at daikokuya dot co dot uk 2003-07-19 16:07 -------
Subject: Re: No warning for "if(foo)" instead of "if(foo())"
gdr at integrable-solutions dot net wrote:-
> | it. I just hope the GCC compiler, if it's possible,
> | will give a warning message as other compilers do, so
> | users could see their mistakes. This warning is the
> | same warning of :
> | if ( a_number = another_number)
>
> I don't think so.
> And for that warning, we got existing practice. For
>
> if(foo)
>
> we've already got existing pratice the other way around.
For the case that foo is a function name, which is what this whole PR
is about, it's very rare. I don't remember ever having had the need to
write such a line.
Regardless, I don't think it was appropriate to close this PR. It
could be treated as a fully justifiable request for a new -W option.
Neil.