From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10128 invoked by alias); 9 Aug 2019 16:23:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 10115 invoked by uid 89); 9 Aug 2019 16:23:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Aug 2019 16:23:02 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72E7D14AFA3; Fri, 9 Aug 2019 16:23:01 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-200.ams2.redhat.com [10.36.116.200]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1B69B5C29A; Fri, 9 Aug 2019 16:23:00 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x79GMw5P020639; Fri, 9 Aug 2019 18:22:59 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x79GMv9P020637; Fri, 9 Aug 2019 18:22:57 +0200 Date: Fri, 09 Aug 2019 16:51:00 -0000 From: Jakub Jelinek To: Martin Sebor Cc: gcc-patches Subject: Re: [PATCH] fold more string comparison with known result (PR 90879) Message-ID: <20190809162257.GB2726@tucnak> Reply-To: Jakub Jelinek References: <223e6275-98b9-f46d-a5c0-4ea802a68aaf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <223e6275-98b9-f46d-a5c0-4ea802a68aaf@gmail.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00643.txt.bz2 On Fri, Aug 09, 2019 at 10:17:12AM -0600, Martin Sebor wrote: > --- a/gcc/gengtype-state.c > +++ b/gcc/gengtype-state.c > @@ -79,6 +79,14 @@ enum state_token_en > STOK_NAME /* hash-consed name or identifier. */ > }; > > +/* Suppress warning: ISO C forbids zero-size array for stok_string > + below. The arrays are treated as flexible array members but in > + otherwise an empty struct or as a member of a union cannot be > + declared as such. They must have zero size to keep GCC from > + assuming their bound reflect their size. */ > +#pragma GCC diagnostic push > +#pragma GCC diagnostic ignored "-Wpedantic" > + > > /* Structure and hash-table used to share identifiers or names. */ > struct state_ident_st > @@ -86,11 +94,10 @@ struct state_ident_st > /* TODO: We could improve the parser by reserving identifiers for > state keywords and adding a keyword number for them. That would > mean adding another field in this state_ident_st struct. */ > - char stid_name[1]; /* actually bigger & null terminated */ > + char stid_name[0]; /* actually bigger & null terminated */ No, please don't do this. The part of the GCC that is built by system compiler shouldn't use GNU extensions, unless guarded only for compilation with compilers that do support that. Jakub