[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



> > A similar algorithm does not exist for reliably determining that a
> > function falls off its end.
> 
> What if there is no return statement in a function with a non-void return 
> type?

Like this?

int foo(){
  exit(3);
}

Has no return statement, but still doesn't invoke undefined behavior.

Regards,
Martin



Reply to: