This is the mail archive of the gcc@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]

Re: "no return statement" warning weirdness


Chris Lattner wrote:-

> >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() {}

Why?  If it's a void function it only takes another 5 keystrokes to make
it so.

Neil.


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