[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#119440: g++: Compiler does not give any errors when a function fails to return required value



> I believe that Martin and the others are saying that
> -Wreturn-type catches this specific problem, but that it is not the
> default behaviour because the code is still valid (although the outcome
> may not be what the programmer desired).  Am I correct?  

Close. The code is valid, but that alone wouldn't stop gcc from
detecting undefined behaviour at compile time by default.

It is the not the default because there are programs where the warning
triggers, even though the programs never trigger undefined behaviour.

Regards,
Martin



Reply to: