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 CF9EB38515F8 for ; Wed, 31 Aug 2022 20:09:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CF9EB38515F8 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="5.93,279,1654588800"; d="scan'208";a="85016176" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 31 Aug 2022 12:09:46 -0800 IronPort-SDR: WWNMaMWPoegOKGqNuvTq3T1pHPazrf5iENv9HY5fIpND4cZitAT6n3km0pGXgQHwNHykmV2YlY OkW3eQXi6r+m4z8/RhwAOr3TwtW2NRYU549aVCV/RRSsCpKynljVl0LNn4m5nOPvd5U+e9CYBc G/kqAkzW6/RrN3La6FPGREyZ19OQM35xT2E7aCYrsUYAAisss8u6UqqDL5KKg6DW4As/V3bCew lnd2wk9fVytiwa4WUCziHrtG88B0JATImYyq8cWU9xEyUCgdIp8hwySmSURHtzeWeLsp91icPh a3I= Date: Wed, 31 Aug 2022 20:09:40 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Qing Zhao CC: jakub Jelinek , richard Biener , Kees Cook , gcc Patches , Nathan Sidwell , martin Sebor Subject: Re: [[GCC13][Patch][V3] 1/2] Add a new option -fstrict-flex-array[=n] and new attribute strict_flex_array In-Reply-To: <6A951E15-051F-4DBB-97B0-F51DF1E0F7D6@oracle.com> Message-ID: References: <20220817144042.2931674-1-qing.zhao@oracle.com> <2C0B6A60-A27D-4B96-9559-096712EC32FA@oracle.com> <6A951E15-051F-4DBB-97B0-F51DF1E0F7D6@oracle.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3111.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 Wed, 31 Aug 2022, Qing Zhao wrote: > >> When -std=gnu89 + -fstrict-flex-array=3 (ONLY C99 flexible array member > >> [] is treated as a valid flexible array) present together, > > > > That seems reasonable enough without a warning. If people want a warning > > for flexible array members in older language modes, they can use > > -pedantic; I don't think we need to warn for any particular > > -fstrict-flex-array modes there. > > So, you mean, > > 1. GCC with -std=gnu89 support all [0], [1], and [] as Flexible array member; > 2. Therefore. -std=gnu89 + -fstrict-flex-array=3 does not need a warning; > > ? Yes. > Then, how about: > > -std=c89: > > 1. GCC with -std=c89 also support all [0], [1], and [] as Flexible array member; > 2, therefore, -std=c89 + -fstrict-flex-array does not need a warning too. > > ? Yes. -- Joseph S. Myers joseph@codesourcery.com