The "noreturn" attribute should be used to indicate that a function does not return to its caller: it may terminate the program, enter an infinite
loop, or throw an exception.
This attribute is typically used for functions that perform critical operations, such as exiting the program or handling an error condition. For
example, the "exit" function is marked with the "noreturn" attribute because it terminates the program and does not return to its caller.
Using this attribute allows the compiler to make some assumptions that can lead to optimizations. However, functions marked with the "noreturn"
attribute should not have a return statement because it leads to undefined behavior and unexpected results.
This rules equally applies to C++11 [[noreturn]]
notation or C11 _Noreturn
keyword notation. It raises an issue when the
attribute is incorrectly used.