Skip to content

Commit 8bc2465

Browse files
author
ripley
committed
more on setting C standards
git-svn-id: https://svn.r-project.org/R/trunk@87372 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent dc33181 commit 8bc2465

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

doc/manual/R-admin.texi

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,17 +1070,25 @@ suffice.
10701070
@node C standards
10711071
@subsection C standards
10721072

1073+
Comiling @R{} requires some POSIX features (such as
1074+
@code{strdup}@footnote{this is part of C23, but part of the C library
1075+
not the compiler.} and the @code{ssize_t} type) not in the C
1076+
standards. Typically compilers make these available, but @strong{not} if
1077+
strict C compliance is specified by for example @option{-std=c17}. So
1078+
if you want to specify a non-default standard use something like
1079+
@option{-std=gnu23}.
1080+
10731081
Compiling @R{} requires C99 or later: C11 and C17 are minor updates, but
1074-
the substantial update planned for `C23' (finally published in October
1075-
2024) will also be supported.
1082+
the substantial update `C23' (finally published in October 2024) is also
1083+
supported for current versions of GCC and @command{clang}.
10761084

10771085
As from @R{} 4.3.0 there is support for packages to indicate their
10781086
preferred C version. Macros @code{CC17}, @code{C17FLAGS}, @code{CC23}
10791087
and @code{C23FLAGS} can be set in @file{config.site} (there are examples
10801088
there). Those for C17 should support C17 or earlier and not allow C23
10811089
additions so for example @code{bool}, @code{true} and @code{false} can
1082-
be used as identifiers. Those for C23 should support new types such as
1083-
@code{bool}.
1090+
be used as identifiers. Those for C23 should support the new types such
1091+
as @code{bool}.
10841092

10851093
Some compilers warn enthusiastically about prototypes. For most,
10861094
omitting @option{-Wstrict-prototypes} in @code{C17FLAGS} suffices.

0 commit comments

Comments
 (0)