www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - No warning for missing return value

It seems that the 2 warnings
- implied return at closing '}' does not return value
- no return value for function 'identifier'
are never generated even though all warnings are enabled

For example:

int add (int a,  int b)
{
    int  res;
    if (a == 0) return;  // no return value

    res = a + b;

 }  // missing "return res" here

Tested with compiler version 8.27 and 8.33
Apr 29 2003