3 ms·
From an ISO C conformance viewpoint, it is neither "correct" nor "incorrect" to fail to generate a diagnostic that is not required by ISO C. In the ISO C++ lan
by kazinator 8y ago
From an ISO C conformance viewpoint, it is neither "correct" nor "incorrect" to fail to generate a diagnostic that is not required by ISO C.
In the ISO C++ language, I vaguely seem to recall ("I could have sworn that") that failing to return a value from a function is a diagnosable semantic rule violation. And that it has been for a very long time.
So I fully sympathize with the "mind is blown" comment in grandparent.
Hey, g++ -pedantic catches some important semicolon trespasses, though:
noreturn.cc:19:2: warning: extra ‘;’ [-pedantic]
noreturn.cc:25:2: warning: extra ‘;’ [-pedantic]
:)