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]

bug egcs 1.1.1


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


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