From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id DF97A3858C2C for ; Fri, 26 May 2023 18:15:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF97A3858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="6.00,194,1681200000"; d="scan'208";a="7623164" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 26 May 2023 10:15:52 -0800 IronPort-SDR: Hhs/52Qobeo8bwvG4it88u7unaqPQY9wjZbezLl3qHdUbRlRGN/sA275t2Jb7Nn/vvS6tiUKW3 cTshb4FQQXVzTD1bzEDXZpyBY4Qy8ueDS+BKMCvzEb4kz73gIHegZ+cXZPSr+eW2Mu18f0MWBs 1UizVNiZj3J7UxMvLdTtHSIVql8Th4MwaM9i8ZhTgGLA4hWZMo2EDEMuknysbfF+3lhBsFRZfZ hwsIt1nvTNOujV1clmIl0UuGw7BFiv4iLglC3zExiHDquj/AmYAyqCbTjIPtXq1wKkc0YdHeM0 Pzo= Date: Fri, 26 May 2023 18:15:48 +0000 From: Joseph Myers To: Qing Zhao CC: "richard.guenther@gmail.com" , "jakub@redhat.com" , "gcc-patches@gcc.gnu.org" , "keescook@chromium.org" , "siddhesh@gotplt.org" , "uecker@tugraz.at" , "isanbard@gmail.com" Subject: Re: [V1][PATCH 1/3] Provide element_count attribute to flexible array member field (PR108896) In-Reply-To: <28BEA1DA-5277-493D-8C85-1C204AD1B70F@oracle.com> Message-ID: References: <20230525161450.3704901-1-qing.zhao@oracle.com> <20230525161450.3704901-2-qing.zhao@oracle.com> <28BEA1DA-5277-493D-8C85-1C204AD1B70F@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3106.4 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 26 May 2023, Qing Zhao via Gcc-patches wrote: > > What if the string is a wide string? I don't expect that to work (either > > as a matter of interface design, or in the present code), but I think that > > case should have a specific check and error. > > Dump question: how to check whether the string is a wide string? -:) By examining the element type; the only valid case for the attribute would be an element type of (const) char. (I think it's reasonable to reject all of char8_t, char16_t, char32_t, wchar_t strings in this context.) -- Joseph S. Myers joseph@codesourcery.com