Re: Control reaches end of non-void function: why only a warning?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dixit Ryan Mansfield (2005-11-15 13:15):
> > But that seems relatively rare, and I for one would not mind being
> > forced to add a dummy return statement after the call to exit().
> > The benefit of having a more rigorous compiler would outweigh this
> > slight inconvenience.
> 
> If you want to be forced then turn the warning into an error
> with -Werror

Not a bad idea, but in many situations, I am compiling a large
project whose code generates many warnings, and turning them all
into errors would be unworkable.

I have patched my copy of the gcc sources to turn this warning
into an error, but I'm still curious to see an example of when it
is useful to knowingly allow the control flow to leave a function
with an undefined return value.

-- 
Pierre Sarrazin <sarrazip at sympatico dot ca>

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux