This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: "no return statement" warning weirdness
- From: Chris Lattner <sabre at nondot dot org>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>,<gcc at gcc dot gnu dot org>
- Date: Thu, 18 Mar 2004 14:49:02 -0600 (CST)
- Subject: Re: "no return statement" warning weirdness
>> This appears to be due to a check for C_FUNCTION_IMPLICIT_INT before
>> emitting the warning: when using just 'long', this flag is set to 1,
>> and if the flag is 1 the warning is not output.
>>
>> Is this supposed to work that way?
>IMO we should warn whether implicit int or not.
I speculate that this is attempting to avoid warning in cases like this:
foo() {}
... Where the function defaults to returning int, though the programmer
may never use the return value. I think that it's reasonable to avoid
warning on that function, but it is still important to warn on the
slightly different:
int foo() {}
-Chris
--
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/