From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by sourceware.org (Postfix) with ESMTPS id C3A1E3857828 for ; Sat, 26 Sep 2020 00:42:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C3A1E3857828 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=saagarjha.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=saagarjha28@gmail.com Received: by mail-pl1-f195.google.com with SMTP id f1so159399plo.13 for ; Fri, 25 Sep 2020 17:42:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OokhYy5B4hiAxxpWtNGvynfs6YxY6G/nsHmRiBxDaj8=; b=OdVPTBLEQHIdCesYlCYWB0hqhOOnRV062NUgH/lwHTJH1v1jwPvDCT5YpW8+Gfu6cJ DaQIbvx5C8+lsgQWlCeGkgDzGGeeWNOAWUUbKgdaeDsQ4ZA19VMQgjef3voSWwM+Kyj+ 5wXUVPpmzDreNSeSIl9tnOIHosOVdLqilddWqqDxv19ECwIRGVMftB8FIcdBOiwp/eeR HASzYgWEW8z+RFmGtrYuqz2f/0QSufxW47FqlKcIU8yLb6gfaCyh1yGfXtYP3LRWCPSu nhqTWDWGy1fPmZH1Ws61QLkNpX61rUp5KNOffw7bcDI/3Cu0TcSbTpkRBWEsgPbOembY XscA== X-Gm-Message-State: AOAM531IR2FTFa4PlaZVk1sk/xucwqrXUd8y3J7dzybuNaBD0irLk2br rS7PkQRmjWDtqiC2rjbxHxqbXFTRveg= X-Google-Smtp-Source: ABdhPJwM5gSF8/hoH92uXE63xrb3PhOr0stJg4pCxSDSbhVKL2rB609w6QsIzYXB+rvxqbcYf5QvhQ== X-Received: by 2002:a17:90b:889:: with SMTP id bj9mr141894pjb.73.1601080960580; Fri, 25 Sep 2020 17:42:40 -0700 (PDT) Received: from localhost.localdomain (c-73-92-124-25.hsd1.ca.comcast.net. [73.92.124.25]) by smtp.gmail.com with ESMTPSA id z63sm3751025pfz.187.2020.09.25.17.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 17:42:40 -0700 (PDT) From: Saagar Jha To: binutils@sourceware.org Cc: Saagar Jha Subject: [PATCH] Fix a warning when initializing symbol_flags Date: Fri, 25 Sep 2020 17:42:24 -0700 Message-Id: <20200926004224.35168-1-saagar@saagarjha.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 00:42:43 -0000 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. gas/ChangeLog: * symbols.c: Shorten an initializer for symbol_flags to be empty. --- gas/ChangeLog | 4 ++++ gas/symbols.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 1c692dd931..6f9e842330 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2020-09-25 Saagar Jha + + * symbols.c: Shorten an initializer for symbol_flags to be empty. + 2020-09-24 Jim Wilson PR 26400 diff --git a/gas/symbols.c b/gas/symbols.c index d6080886be..40d7ebc586 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -196,7 +196,7 @@ static void * symbol_entry_find (htab_t table, const char *name) { hashval_t hash = htab_hash_string (name); - symbol_entry_t needle = { { { 0 }, hash, name, 0, 0, 0 } }; + symbol_entry_t needle = { { { }, hash, name, 0, 0, 0 } }; return htab_find_with_hash (table, &needle, hash); } -- 2.28.0