Skip to content

Commit e037549

Browse files
author
ripley
committed
gcc pre-15 does not yet support [[noreturn]]
git-svn-id: https://svn.r-project.org/R/trunk@87411 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 33555bd commit e037549

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/include/R_ext/Error.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ extern "C" {
4141

4242
/* C23 has a [[noreturn]] attribute supported in GCC 13 and LLVM clang
4343
* 15 with -std=c2x but not Apple clang 14. All have version 202000L.
44+
* clang 19 has version 202301L
45+
* gcc pre-15 supports -std=gnu23 with version 202301L but does not
46+
* support (and barfs on) this attribute, so restrict to clang for now.
47+
*
4448
* In C11 there is _Noreturn * (or noreturn in header <stdnoreturn.h>).
4549
*/
4650
#if defined NORET
47-
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202301L)
51+
#elif (defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202301L)
4852
# define NORET [[noreturn]]
4953
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201102L
5054
# define NORET _Noreturn

0 commit comments

Comments
 (0)