This is the mail archive of the gcc-bugs@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: No warning when return type is missing


On Feb  5, 1999, us@ooc.de (Uwe Seimet) wrote:

> T* foo() { The code in here doesn't return anything.  }

> When compiling such an example with c++ even with -Wall or -Wno-return-type
> you don't get any warning and implicitly a null pointer seems to be
> returned.

The following program:

void *foo() {}

compiled with egcs-1.1.1 -Wall produces:

t.cc: In function `void * foo()':
t.cc:1: warning: control reaches end of non-void function `foo()'

If you don't post a complete code snippet, we won't be able to
reproduce the problem you're reporting.

-- 
Alexandre Oliva  http://www.dcc.unicamp.br/~oliva  aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Universidade Estadual de Campinas, SP, Brasil



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