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

Oliver Kullmann O.Kullmann@swansea.ac.uk
Tue Nov 15 16:31:00 GMT 2005


On Tue, Nov 15, 2005 at 11:23:15AM -0500, Pierre Sarrazin wrote:
> The following code generates the warning "control reaches end of
> non-void function" under g++ 3.4.2:
> 
> int g()
> {
> }
> 
> Why is this only a warning and not an error?
>

Simply because this is legal code.



More information about the Gcc-help mailing list