@@ -3187,15 +3187,14 @@ compiler is to include an empty C++ file in @file{src}..
31873187@subsection C standards
31883188
31893189C has had standards C89/C90, C99, C11, C17 (also known as C18), and C23
3190- is in final draft and expected to be published in 2024. C11 was a
3191- minor change to C99 which introduced some new features and made others
3192- optional, and C17 is a `bug-fix' update to C11. On the other hand, C23
3193- makes extensive changes, including making @code{bool}, @code{true} and
3194- @code{false} reserved words, finally disallowing K&R-style function
3195- declarations and clarifying the formerly deprecated meaning of function
3196- declarations with an empty parameter list to mean zero
3197- parameters. (There are many other additions: see for example
3198- @uref{https://en.cppreference.com/w/c/23}.)
3190+ (published in 2024). C11 was a minor change to C99 which introduced
3191+ some new features and made others optional, and C17 is a `bug-fix'
3192+ update to C11. On the other hand, C23 makes extensive changes,
3193+ including making @code{bool}, @code{true} and @code{false} reserved
3194+ words, finally disallowing K&R-style function declarations and
3195+ clarifying the formerly deprecated meaning of function declarations with
3196+ an empty parameter list to mean zero parameters. (There are many other
3197+ additions: see for example @uref{https://en.cppreference.com/w/c/23}.)
31993198
32003199The @command{configure} script in recent versions of @R{} aims to choose
32013200a C compiler which supports C11: as the default in recent versions of
@@ -3223,8 +3222,8 @@ LDFLAGS=`"$@{R_HOME@}/bin/R" CMD config LDFLAGS`
32233222The (claimed) C standard in use can be checked by the macro
32243223@code{__STDC_VERSION__}. This is undefined in C89/C90 and should have
32253224values @code{199901L}, @code{201112L} and @code{201710L} for C99, C11
3226- and C17. As C23 is not yet published there is as yet no definitive
3227- value: compilers are currently using @code{202000L}.
3225+ and C17. The definitive value for C23 seems to be @code{202311L} but
3226+ compilers are currently using @code{202000L}.
32283227@c https://gustedt.gitlabpages.inria.fr/c23-library/
32293228C23 has macros similar to C++ `feature tests' for many of its changes,
32303229for example @code{__STDC_VERSION_LIMITS_H__}.
@@ -6163,12 +6162,12 @@ run-time path to the library.
61636162
61646163@item
61656164Package authors commonly assume things are part of C/C++ when they are
6166- not: the most common example is POSIX@footnote{Although this is expected
6167- to be part of C23, full support of that is years away.} function
6168- @code{strdup}. The most common C library on Linux, @code{glibc}, will
6169- hide the declarations of such extensions unless a `feature-test macro'
6170- is defined @strong{before} (almost) any system header is included. So
6171- for @code{strdup} you need
6165+ not: the most common example is POSIX@footnote{Although this was added
6166+ for C23, full support of that is years away.} function @code{strdup}.
6167+ The most common C library on Linux, @code{glibc}, will hide the
6168+ declarations of such extensions unless a `feature-test macro' is defined
6169+ @strong{before} (almost) any system header is included. So for
6170+ @code{strdup} you need
61726171@example
61736172#define _POSIX_C_SOURCE 200809L
61746173...
@@ -6323,8 +6322,8 @@ This has found quite a number of errors where functions have been
63236322declared without arguments and is likely to become the default in future
63246323compilers. (It already is for Apple @command{clang} and for @I{LLVM}
63256324@command{clang} in C23 mode.) Note that using @code{f()} for a function
6326- without any parameters was deprecated in C99 and C11, but it expected to
6327- be non-deprecated in C23. However, @code{f(void)} is supported by all
6325+ without any parameters was deprecated in C99 and C11, but it became
6326+ non-deprecated in C23. However, @code{f(void)} is supported by all
63286327standards and avoids any uncertainty.
63296328@c draft n3054 §6.7.6.3 point 13 and footnote.
63306329
@@ -6402,7 +6401,7 @@ So the values will need to be cast to the type assumed by the format
64026401@I{Variadic} macros in C or C++ only portably allow a non-zero number of
64036402arguments, although some compilers have allowed zero, often with a
64046403warning. The latter was standardized in C++20 using the @code{__VA_OPT__}
6405- macro. C23 will also allow zero arguments in a similar way.
6404+ macro. C23 also allows zero arguments in a similar way.
64066405
64076406@end itemize
64086407
@@ -11467,7 +11466,7 @@ is easy to specify the arguments for @code{.Call} (all @code{SEXP}) and
1146711466and @code{.Fortran} are all pointers, specifying them as @code{void *}
1146811467suffices. (For most platforms one can omit all the arguments, although
1146911468link-time optimization will warn, as will compilers set up to warn on
11470- strict prototypes -- and C23 will require correct arguments.)
11469+ strict prototypes -- and C23 requires correct arguments.)
1147111470
1147211471Using @option{-fc-prototypes-external} will give a prototype using
1147311472@code{int_least32_t *lgl} for Fortran @code{LOGICAL LGL}, but this is
0 commit comments