From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 06A463858C50 for ; Thu, 9 Feb 2023 13:14:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 06A463858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from r6.localdomain (82-217-174-174.cable.dynamic.v4.ziggo.nl [82.217.174.174]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id EA77C30067CA; Thu, 9 Feb 2023 14:14:02 +0100 (CET) Received: by r6.localdomain (Postfix, from userid 1000) id 9D5593401E7; Thu, 9 Feb 2023 14:14:01 +0100 (CET) Message-ID: <00261e8205b96da02709a3651dcd2e80098db81e.camel@klomp.org> Subject: Re: [PATCH v2 1/7] libasm: Fix xdefault_pattern initialization From: Mark Wielaard To: Ilya Leoshkevich Cc: elfutils-devel@sourceware.org Date: Thu, 09 Feb 2023 14:14:01 +0100 In-Reply-To: <20230208195226.144143-2-iii@linux.ibm.com> References: <20230208195226.144143-1-iii@linux.ibm.com> <20230208195226.144143-2-iii@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 (3.46.3-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-3030.0 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,TXREP 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: Hi Ilya, On Wed, 2023-02-08 at 20:52 +0100, Ilya Leoshkevich wrote: > clang complains: >=20 > asm_newscn.c:48:22: error: field 'pattern' with variable sized type '= struct FillPattern' not at the end of a struct or class is a GNU extension = [-Werror,-Wgnu-variable-sized-type-not-at-end] > struct FillPattern pattern; > ^ >=20 > Fix by using a union instead. Define the second union member to be a > char array 1 byte larger than struct FillPattern. This should be legal > according to 6.7.9: >=20 > If an object that has static or thread storage duration is not > initialized explicitly, then ... if it is a union, the first named > member is initialized (recursively) according to these rules, and > any padding is initialized to zero bits. >=20 Thanks, pushed. Mark