Skip to content

Commit af2573f

Browse files
author
ripley
committed
update comments on C23 support
git-svn-id: https://svn.r-project.org/R/trunk@87592 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent a11993d commit af2573f

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

config.site

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@
6969

7070
## Ditto for a compiler that supports C23 features.
7171
## For example 'CC23=clang-15 -std=gnu2x'
72-
## Eventually -std=gnu23 will be supported and preferred.
72+
## -std=gnu2x is supported by at least GCC >= 12, LLVM clang >= 15 and Apple clang >= 16
73+
## Eventually -std=gnu23 will be supported and preferred
74+
## (and is by GCC >= 14 and LLVM >= 18).
7375
## Default to CC and CFLAGS with any -std options removed, then
7476
## -std=gmu2x appended to CC.
7577
## CC23=

doc/manual/R-exts.texi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3196,12 +3196,15 @@ clarifying the formerly deprecated meaning of function declarations with
31963196
an empty parameter list to mean zero parameters. (There are many other
31973197
additions: see for example @uref{https://en.cppreference.com/w/c/23}.)
31983198

3199+
@c GCC 14, LLVM clang 19 and Apple clang 16 default to C17
3200+
@c In 2025-01 GCC pre=15 defaulted to C23 (but did not document so).
31993201
The @command{configure} script in recent versions of @R{} aims to choose
32003202
a C compiler which supports C11: as the default in recent versions of
32013203
@command{gcc}, @I{LLVM} @command{clang} and Apple @command{clang} is C17,
32023204
that is what is likely to be chosen. On the other hand, until @R{} 4.3.0
32033205
the makefiles for the Windows build specified C99. They now use the
3204-
compiler default which for the recommended compiler is C17.
3206+
compiler default which for the recommended compiler is C17. Future
3207+
versions (including @command{gcc}@tie{}15) are likely to default to C23.
32053208

32063209
Packages may want to either avoid or embrace the changes in C23, and can
32073210
do so @emph{via} specifying @samp{USE_Cnn} for 17, 23, 90 or 99 in the

src/include/R_ext/Error.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@
3939
extern "C" {
4040
#endif
4141

42-
/* C23 has a [[noreturn]] attribute supported in GCC 13 and LLVM clang
43-
* 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.
42+
/* C23 has a [[noreturn]] attribute supported in LLVM clang 15 with
43+
* -std=c2x but not Apple clang 14. That and GCC verisions 12-14 have
44+
* version 202000L.
45+
* clang 19 has version 202301L (and supports -std=gnu23).
46+
* gcc pre-15 supports -std=gnu23 with version 202301L but barfs on
47+
* this attribute, so restrict to clang for now.
48+
*
49+
* https://en.cppreference.com/w/c/compiler_support/23
50+
* claims GCC 13 and LLVM clang 15 support [[noreturn]] ....
4751
*
4852
* In C11 there is _Noreturn * (or noreturn in header <stdnoreturn.h>).
4953
*/

0 commit comments

Comments
 (0)