This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
bug or feature ?
- To: gcc at gcc dot gnu dot org
- Subject: bug or feature ?
- From: Neelakanth <neelakanth at gnu dot org>
- Date: Thu, 11 Jan 2001 10:17:53 -0800
- Cc: Neelakanth dot Nadgir at eng dot sun dot com
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