This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Control reaches end of non-void function: why only a warning?
- From: Oliver Kullmann <O dot Kullmann at swansea dot ac dot uk>
- To: Pierre Sarrazin <sarrazip at sympatico dot ca>, gcc-help at gcc dot gnu dot org
- Date: Tue, 15 Nov 2005 16:30:46 +0000
- Subject: Re: Control reaches end of non-void function: why only a warning?
- References: <20051115162315.GA12685@localhost>
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.