Name n3835, alx-0088r1 - noreturn can't return Principles - Codify existing practice to address evident deficiencies - Enable secure programming And from the old C23 charter: - Trust the programmer, as a goal, is outdated in respect to the security and safety programming communities. Category Earthly demon. Author Alejandro Colomar History r0 (2026-02-14): - Initial draft. r1 (2026-02-14; n3845): - wfix Description It makes absolutely no sense to have a [[noreturn]] function that contains a return statement. [[noreturn]] void f(void) { return; // would you mind serving me a dose of Nasal Demons? } More work would be needed to make sure that [[noreturn]] functions can't return. This is a good start, though. A low- hanging fruit. Prior art Both GCC and Clang diagnose --by default--, even in the case where the return statement is unreachable. alx@devuan:~/tmp$ cat nr.c [[noreturn]] void f(void) { if (0) return; for (;;) continue; } alx@devuan:~/tmp$ gcc -S -O3 nr.c nr.c: In function ‘f’: nr.c:5:17: warning: function declared ‘noreturn’ has a ‘return’ statement 5 | return; | ^~~~~~ alx@devuan:~/tmp$ clang -S -O3 nr.c nr.c:5:3: warning: function 'f' declared 'noreturn' should not return [-Winvalid-noreturn] 5 | return; | ^ 1 warning generated. Proposed wording Based on N3783. 6.7.5 Function specifiers @@ Constraints, p5+1 +A function declared with the _Noreturn function specifier +shall not contain a return statement. 6.7.12.7 The noreturn and _Noreturn attributes @@ Constraints, p2+1 +A function declared with the noreturn attribute +shall not contain a return statement.