From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id V2leLVBub2BBHQAAWB0awg (envelope-from ) for ; Thu, 08 Apr 2021 16:57:52 -0400 Received: by simark.ca (Postfix, from userid 112) id ABD391EE0E; Thu, 8 Apr 2021 16:57:52 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2E8801E590 for ; Thu, 8 Apr 2021 16:57:52 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 892FE3857033; Thu, 8 Apr 2021 20:57:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 892FE3857033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1617915471; bh=RYBkA3LIpMDxunmCkGDbXHPFnGZBI0CI5y/wB2PvKN0=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=d/XLPP0DZRC3KUtYslu5FRVcXDzyVYSSpjgf3XNwgyZ75xmY3nb8mWQ/gZQUE6v8f RaEx5Slt3PpXBOs+QebKsbK9aE4dS7BkOfz3WKkCsb8fzEDXjnDrf4rXNaVi1UNtrL jgI+nrNWUkKYf0fTWgNDmTkjFweus4Bwp41Kjg6o= Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 868263857033 for ; Thu, 8 Apr 2021 20:57:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 868263857033 Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 85AEF340D5C; Thu, 8 Apr 2021 20:57:47 +0000 (UTC) Date: Thu, 8 Apr 2021 16:57:46 -0400 To: Luis Machado Subject: Re: [PATCH] [sim,rx] Silence warning that turns into a build error Message-ID: Mail-Followup-To: Luis Machado , gdb-patches@sourceware.org References: <20210408195143.1349459-1-luis.machado@linaro.org> <07869142-e6ce-b480-56dc-334f2108e4b0@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <07869142-e6ce-b480-56dc-334f2108e4b0@linaro.org> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 08 Apr 2021 17:23, Luis Machado via Gdb-patches wrote: > On 4/8/21 5:16 PM, Mike Frysinger wrote: > > On 08 Apr 2021 16:51, Luis Machado via Gdb-patches wrote: > >> + FP_Parts a = {0, 0, 0, 0, 0}; > > > > wouldn't it be simpler & equiv: > > FP_Parts a = {}; > > I find that it works, but I'm unsure if it is a standard way of doing it. > > The C reference says: > > "When initializing an object of struct or union type, the initializer > must be a non-empty, brace-enclosed, comma-separated list of > initializers for the members." > > So I went with the most obvious, as opposed to going shorter and more > opaque. my concern is more about having to tweak this whenever fields are added or removed. i couldn't remember if the ={} syntax was a C++ extension, or in C11. if it's a C++ extension, i *think* ={0} will work even in C11. -mike