Andreas Schwab wrote: > James Dennett <james.denn...@gmail.com> writes: > >> This appears to be a difference between C and C++. Unfortunate. >> 6.6.3 [stmt.return]/2 of N2800 says "Flowing off the end of a function >> is equivalent to a return with no value; this results in undefined >> behavior in a value-returning function." > > Since it's merely undefined behavior the compiler cannot reject it, > because if the function is never called the undefined behavior does not > happen.
Yes, James did mention "[if it] is called at all" in his earlier post. cheers, DaveK