Hi Paul,
> This implements a replacement for C11's <stdnoreturn.h>.
On MSVC 9, I now get a compilation error:
/home/bruno/msvc/compile cl -nologo -DHAVE_CONFIG_H -I. -I..
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I. -I.. -I./.. -I../gllib
-I./../gllib -D_WIN32_WINNT=_WIN32_WINNT_WINXP -MD -c -o test-stdnoreturn.obj
test-stdnoreturn.c
test-stdnoreturn.c
C:\Programme\Microsoft Visual Studio 9.0\VC\include\stdlib.h(371) : error
C2485: '__declspec': nichterkanntes erweitertes Attribut
C:\Programme\Microsoft Visual Studio 9.0\VC\include\stdlib.h(371) : error
C2059: Syntaxfehler: '('
C:\Programme\Microsoft Visual Studio 9.0\VC\include\stdlib.h(372) : error
C2485: '__declspec': nichterkanntes erweitertes Attribut
C:\Programme\Microsoft Visual Studio 9.0\VC\include\stdlib.h(372) : error
C2059: Syntaxfehler: '('
../gllib\stdlib.h(446) : error C2485: '_Noreturn': nichterkanntes erweitertes
Attribut
make[4]: *** [test-stdnoreturn.obj] Error 2
The code in line 371, 372 of stdlib.h contains declarations of 'exit' and
'_exit', with the attribute __declspec(noreturn). Likewise also in
setjmp.h, process.h, and some other .h files.
The current set of definitions
#define _Noreturn __declspec (noreturn)
#define noreturn _Noreturn
leads to a syntax error when someone writes __declspec (noreturn),
because preprocessing transforms it to __declspec (__declspec (noreturn)).
How can this syntax error be avoided?
Bruno