This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug c/10170] No warning for "if(foo)" instead of "if(foo())"
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2003 18:43:18 +0200
- Subject: Re: [Bug c/10170] No warning for "if(foo)" instead of "if(foo())"
- Organization: Integrable Solutions
- References: <20030320182600.10170.xkinh@yahoo.com><20030719152447.22067.qmail@sources.redhat.com><20030719160703.GI22306@daikokuya.co.uk>
Neil Booth <neil@daikokuya.co.uk> writes:
| 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.
so you're not affected ;-).
More seriously: That is the advertised way to handle (external weak)
functions defined in dynamically loaded library or such.
you might find the way it works here (in the first paragraph):
http://sources.redhat.com/ml/binutils/1999-q3/msg00053.html
http://sources.redhat.com/ml/bug-glibc/2001-10/msg00001.html
-- Gaby