Searched hist:"112 f2106470d3459b7ab29042e0e5144906473a2" (Results 1 – 1 of 1) sorted by relevance
/freebsd/include/ |
H A D | stdnoreturn.h | diff 112f2106470d3459b7ab29042e0e5144906473a2 Wed Jan 04 00:05:23 CET 2012 Ed Schouten <ed@FreeBSD.org> Simply disallow <stdnoreturn.h> to be used in combination with C++.
There is no way one could possibly use this header file in combination with C++ code. The problem is that in C11 the `noreturn' macro expands to the `_Noreturn' function specifier, while in C++11 the `noreturn' keyword is an attribute.
So in C11 you have to write:
noreturn void exit(int status);
While in C++11 you have to write:
[[noreturn]] void exit(int status);
It is impossible to #define noreturn for C++ in such a way that it allows both conventions.
By intentionally breaking this header this way, we prevent people from using this header in their C++<11 sources.
|