This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bug or feature ?
- To: neelakanth at gnu dot org
- Subject: Re: bug or feature ?
- From: Mike Stump <mrs at windriver dot com>
- Date: Thu, 11 Jan 2001 13:16:08 -0800 (PST)
- Cc: gcc at gcc dot gnu dot org
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.