This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bug egcs 1.1.1
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: bug egcs 1.1.1
- From: nradisch at panix dot com
- Date: Sun, 20 Jun 1999 15:20:41 -0400
If a function that should return a value does not, no error or warning
is given. This frequently results in hard to find program crashes.
int foo(void)
{
if (something == 5) return 12;
}
no warning or error is reported in this case, even though there is
a good chance that the code path with no return will execute.
In simple cases (like above) there is frequently no harm. However, if
the return value is something complex, like an object, the program
goes berserk.
I know many companies that have not used GCC soley for this reason. It's
an easy programming mistake that, if the compiler does not catch it, can
be near impossible to track down
Neil Radisch