Function declared returning something returns nothing

Alexandre Oliva
Fri Apr 30 23:15:00 GMT 1999

On Apr 22, 1999, Edward_C_Morgan <> wrote:

> My question is: Shouldn't the compiler warned about functions not
> returning anything, or at least not returning what it says it
> returns?

It warns with -Wall.  According to the standard, falling off the end
of a function that does not return void produces undefined
results. (except for main(), that implicitly returns 0)

Alexandre Oliva IC-Unicamp, Brasil
{oliva,Alexandre.Oliva}  aoliva@{,}
*** E-mail about software projects will be forwarded to mailing lists

More information about the Gcc-bugs mailing list