bug or feature ?

Neelakanth neelakanth@gnu.org
Thu Jan 11 10:12:00 GMT 2001


Gcc allows a void function to return a value. it only gives a warning.
Is this a bug or a feature?

there is a demo code that demonstrates this.

/* demo.c */
void foo(int x)
{
   return x;
}

$gcc -c demo.c
demo.c: In function `foo':
demo.c:4: warning: `return' with a value, in function returning void
$


-neelakanth


More information about the Gcc mailing list