[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] stdnoreturn: new module
From: |
Bruno Haible |
Subject: |
Re: [PATCH] stdnoreturn: new module |
Date: |
Tue, 28 Feb 2012 03:29:21 +0100 |
User-agent: |
KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; ) |
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
- [PATCH] stdnoreturn: new module, Paul Eggert, 2012/02/24
- Re: [PATCH] stdnoreturn: new module,
Bruno Haible <=
- Re: [PATCH] stdnoreturn: new module, Bruno Haible, 2012/02/28
- Re: [PATCH] stdnoreturn: new module, Paul Eggert, 2012/02/28
- Re: [PATCH] stdnoreturn: new module, Eric Blake, 2012/02/28
- Re: [PATCH] stdnoreturn: new module, Bruno Haible, 2012/02/28
- Re: [PATCH] stdnoreturn: new module, Paul Eggert, 2012/02/29