commit d3cb3c6648cc15fe1beea6c9799e044cb722148a
Author: Tom Honermann <tom@honermann.net>
Date: Sun May 30 16:57:09 2021 -0400
N2653 char8_t for C: Documentation updates
This change updates documentation for the -fchar8_t option to describe
its affect on C code as proposed in WG14 N2653 for C.
@@ -2884,14 +2884,27 @@ This flag is enabled by default for @option{-std=c++17}.
@itemx -fno-char8_t
@opindex fchar8_t
@opindex fno-char8_t
-Enable support for @code{char8_t} as adopted for C++20. This includes
-the addition of a new @code{char8_t} fundamental type, changes to the
-types of UTF-8 string and character literals, new signatures for
-user-defined literals, associated standard library updates, and new
-@code{__cpp_char8_t} and @code{__cpp_lib_char8_t} feature test macros.
+Enable support for @code{char8_t} for C as proposed in N2653, and for
+C++ as adopted for C++20.
+
+For C, this changes the type of UTF-8 string literals from array of
+@code{char} to array of @code{unsigned char} and defines the
+@code{_CHAR8_T_SOURCE} macro to inform the C standard library that the
+@code{char8_t} typedef name and the @code{mbrtoc8} and @code{c8rtomb}
+functions should be declared by @code{<uchar.h>}, and that the
+@code{atomic_char8_t} typedef name and the @code{ATOMIC_CHAR8_T_LOCK_FREE}
+macro should be defined by @code{<stdatomic.h>}.
+
+For C++, this enables the @code{char8_t} fundamental type, changes the
+type of UTF-8 string literals from array of @code{char} to array of
+@code{char8_t}, changes the type of character literals from @code{char}
+to @code{char8_t}, adds additional @code{char8_t}-based signatures for
+user-defined literals, enables associated standard library updates, and
+defines the @code{__cpp_char8_t} and @code{__cpp_lib_char8_t} feature
+test macros.
This option enables functions to be overloaded for ordinary and UTF-8
-strings:
+strings in C++:
@smallexample
int f(const char *); // #1