From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 3AF52385800F for ; Wed, 31 Aug 2022 19:52:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3AF52385800F 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,278,1654588800"; d="scan'208";a="82132696" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 31 Aug 2022 11:52:33 -0800 IronPort-SDR: xu7eGKiAOsB6z0OLmbNzpPMHawWMcpSpsc6w4Q8NMULPBdFv6bxQjTozDRp6lKFsZEgAQqna2T 6NEVMUO99HCtloV2WKZf3xVPtAoq54zT5DwPEoXgQrXsRd+UiUUnvvV6vrYQW0qaNwAfdxQPz/ y8MA/5RMCDAmpAhu7qA+YEWupH7AztQHtXcV8mlWaga3Sam+JA10Vttu8aOk/2UjW2MwmXp+De sdl9vVgFc+2NjGq0G+KUtygDNlro08+lzdGLkXSDUg0Njl9KT/JW0H9KAISW3Qq0fSt6n7QEC6 Glk= Date: Wed, 31 Aug 2022 19:52:27 +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: <2C0B6A60-A27D-4B96-9559-096712EC32FA@oracle.com> Message-ID: References: <20220817144042.2931674-1-qing.zhao@oracle.com> <2C0B6A60-A27D-4B96-9559-096712EC32FA@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-13.mgc.mentorg.com (139.181.222.13) 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: > Does the above mean that -std=gnu89 does not support C99 flexible array > member, then No. Flexible array members are supported by GCC in all C standards modes. The C90 standard doesn't support them, but that's irrelevant to what GCC supports; it just means a diagnostic is required for strict conformance in pre-C99 modes. > 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. -- Joseph S. Myers joseph@codesourcery.com