_Noreturn marks a function that does not return to its caller during normal execution. Use it only for functions with that control-flow behavior; the declaration communicates a fact that helps both readers and the optimizer. section 7.2 section 17.5
A terminating function
_Noreturn void exit(int status);\n\nCalling exit(s) terminates the program, with the same status role as return s in main. Because control never comes back to the caller, exit is declared with _Noreturn. The macro noreturn provides a more readable form through stdnoreturn.h.\n\nTAKEAWAY: _Noreturn describes an execution path that ends without returning to its caller; it does not describe an ordinary void function that happens to return no value. section 7.2
The same property matters for nonlocal control flow:
- longjmp transfers execution to a target established by setjmp, so the current call does not continue after longjmp. section 17.5
- In the recursive-descent parser, exceptional conditions call longjmp; the surrounding interface handles them through switch cases selected by setjmp. section 17.5
- Knowing that longjmp cannot return lets the compiler simplify branch analysis in the function that invokes it. section 17.5
