This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bug or feature ?


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]