bug or feature ?
Mike Stump
mrs@windriver.com
Thu Jan 11 13:16:00 GMT 2001
This is the wrong list for bug reports, or potential bug reports. Bug
reports and potential bug reports should go to the bug reporting list.
> Date: Thu, 11 Jan 2001 10:17:53 -0800
> From: Neelakanth <neelakanth@gnu.org>
> To: gcc@gcc.gnu.org
> Cc: Neelakanth.Nadgir@eng.sun.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
> $
kankakee bash[1813] gcc -pedantic-errors -ansi -c t.c
t.c: In function `foo':
t.c:1: `return' with a value, in function returning void
It seems reasonable to tighten this up, if it doesn't have any chance
of false positives.
More information about the Gcc
mailing list