This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/10170] No warning for "if(foo)" instead of "if(foo())"


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-19 15:24 -------
Subject: Re:  No warning for "if(foo)" instead of "if(foo())"

"xkinh at yahoo dot com" <gcc-bugzilla@gcc.gnu.org> writes:

| There is no question about right or wrong or how to do

I'm not interpreting your request as "right" or "wrong".
I don't think anyone is talking about "right" or "wrong".

| 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.

| The more user friendly a compiler provides, the more
| users love and use it.  

Sure, that is why the compiler better not emit more noise than
necessary :-) 

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]