From patchwork Mon Jun 7 02:32:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Honermann X-Patchwork-Id: 1488378 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=sQEy8ExG; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FyyCP6GKkz9sPf for ; Mon, 7 Jun 2021 12:35:29 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 757F438515F7 for ; Mon, 7 Jun 2021 02:35:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 757F438515F7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1623033327; bh=0TLeY+wFWoMmR1+3eU33XU/DzXJcBYIL2hLhbxoqLwA=; h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=sQEy8ExGHOFHk4Cswjtnvu9zb8SKIYl+x9HTqsIZ72aSle6kGUToy5nVCJVULzuuk vHPDrmZ18j8Wv+WTh8VZdrYBsyI+0xqGyd+wyaoAYrYNmUYpNTxJJTjztvklUQeOkL 8IeaFHu/vVGeuUfA91ksgFnAU1yTeaQ9BGxA5aXM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp82.ord1d.emailsrvr.com (smtp82.ord1d.emailsrvr.com [184.106.54.82]) by sourceware.org (Postfix) with ESMTPS id 32FDE38515D6 for ; Mon, 7 Jun 2021 02:32:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 32FDE38515D6 X-Auth-ID: tom@honermann.net Received: by smtp19.relay.ord1d.emailsrvr.com (Authenticated sender: tom-AT-honermann.net) with ESMTPSA id 88988600AF for ; Sun, 6 Jun 2021 22:32:14 -0400 (EDT) Subject: [PATCH 3/3]: C N2653 char8_t: Documentation updates To: gcc-patches Message-ID: Date: Sun, 6 Jun 2021 22:32:14 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Language: en-US X-Classification-ID: 3915660f-4cc8-4519-807b-6de6f5e2fabf-1-1 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom Honermann via Gcc-patches From: Tom Honermann Reply-To: Tom Honermann Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This patch updates documentation for the -fchar8_t and -fno-char8_t options to describe their effect on C code as proposed in WG14 N2653 [1]. Tested on Linux x86_64. 2021-05-31 Tom Honermann * doc/invoke.texi (-fchar8_t): update for char8_t support for C. Tom. [1]: WG14 N2653 "char8_t: A type for UTF-8 characters and strings (Revision 1)" http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2653.htm commit d3cb3c6648cc15fe1beea6c9799e044cb722148a Author: Tom Honermann 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. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 5cd4e2d993c..ba4c60a6179 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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{}, and that the +@code{atomic_char8_t} typedef name and the @code{ATOMIC_CHAR8_T_LOCK_FREE} +macro should be defined by @code{}. + +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