From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by sourceware.org (Postfix) with ESMTPS id 228A13857C72 for ; Sat, 26 Sep 2020 13:07:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 228A13857C72 Received: by mail-pj1-x1041.google.com with SMTP id bw23so955032pjb.2 for ; Sat, 26 Sep 2020 06:07:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=4e6qhgm2MUrz3uytZZ5/LjRxaEQp79QVV7MuBbCGhnc=; b=umTmNNZ/T9v6vLth884zRZB7f0aykcL8QUl1qRLJCKTi72HgBEbvuv7HJGMQHGM8oF PCD3y97opDqCqJd3+dZkTPsZQW1CTQUa4Sh7FN2yVAAgI1Sh3ilE6VlTHpvIU+gB7NWD /sjj0pSm2dPPjnBgNbjPgQVKfex+vLdAtk4Ds/tnRTfpBHwNFb0a4kwxWyUac71Vi2JJ /z9W5p8vBuqa6RbFZ3mjnlJ9l5LPCHGtauKcmt9TgCGaXun8TjIBUpAgC8PWbWW/1gom eAX6BGaYHwWGee7sRFqFc9zcZHO1oP7pBQ6Tj49qNZWW5XlkqFhFywtc9hYVcjx0ahFF sLlg== X-Gm-Message-State: AOAM5314C4x0N86+b8yU6wpPpgXMihW8AEJ+muZwBmTiZYIbciyMvqUB TGJVEVYX8IfAhXQ2d709Ph0= X-Google-Smtp-Source: ABdhPJz8YjqduDmC3VnYgxCaZeBbbjWPqWal9P2UgfCeZ0Kdol9E2ldppCWfJrGlJ4q7ofgmi7qxBQ== X-Received: by 2002:a17:902:8e8b:b029:d2:4276:1df0 with SMTP id bg11-20020a1709028e8bb02900d242761df0mr3782929plb.62.1601125621151; Sat, 26 Sep 2020 06:07:01 -0700 (PDT) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:ddd:3d9b:550:baab]) by smtp.gmail.com with ESMTPSA id r188sm1706823pfc.67.2020.09.26.06.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 06:07:00 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 5A29F82E51; Sat, 26 Sep 2020 22:36:56 +0930 (ACST) Date: Sat, 26 Sep 2020 22:36:56 +0930 From: Alan Modra To: Saagar Jha Cc: binutils@sourceware.org Subject: Re: [PATCH] Fix a warning when initializing symbol_flags Message-ID: <20200926130656.GR5452@bubble.grove.modra.org> References: <20200926004224.35168-1-saagar@saagarjha.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200926004224.35168-1-saagar@saagarjha.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2020 13:07:03 -0000 On Fri, Sep 25, 2020 at 05:42:24PM -0700, Saagar Jha wrote: > Clang on certain platforms (such as arm64) will warn if a struct is > partially initialized: > > symbols.c:199:35: error: missing field 'written' initializer [-Werror,-Wmissing-field-initializers] > 2895 symbol_entry_t needle = { { { 0 }, hash, name, 0, 0, 0 } }; > > If we use empty braces we have the same effect but avoid the warning. But on gcc-4.9 this results in: symbols.c: In function ‘symbol_entry_find’: symbols.c:199:3: error: missing initializer for field ‘local_symbol’ of ‘struct symbol_flags’ [-Werror=missing-field-initializers] symbol_entry_t needle = { { { }, hash, name, 0, 0, 0 } }; ^ symbols.c:39:16: note: ‘local_symbol’ declared here unsigned int local_symbol : 1; ^ So I don't think we should apply your patch. -- Alan Modra Australia Development Lab, IBM