From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id E9A933898524 for ; Thu, 30 Apr 2020 19:16:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E9A933898524 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1jUEfe-0005oN-VG; Thu, 30 Apr 2020 19:16:30 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1jUEfe-0005yV-Qh; Thu, 30 Apr 2020 21:16:30 +0200 From: Florian Weimer To: Joseph Myers Cc: Mayshao-oc , "H.J. Lu" , "Qiyuan Wang\(BJ-RD\)" , "Cooper Yan\(BJ-RD\)" , "Herry Yang\(BJ-RD\)" , GNU C Library , "Ricky Li\(BJ-RD\)" Subject: Re: [PATCH v3 2/3] x86: Add cache information support for Zhaoxin processors References: <1587731372-9324-1-git-send-email-mayshao-oc@zhaoxin.com> <1587731372-9324-3-git-send-email-mayshao-oc@zhaoxin.com> <205594b758b74c338aec7fad168d9bf4@zhaoxin.com> <2bd2c586658340a88e018b39f0a2771e@zhaoxin.com> Date: Thu, 30 Apr 2020 21:16:30 +0200 In-Reply-To: (Joseph Myers's message of "Thu, 30 Apr 2020 19:10:17 +0000") Message-ID: <87lfmc7pip.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-23.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2020 19:16:38 -0000 * Joseph Myers: > This has broken the build for 32-bit x86. > > In file included from ../sysdeps/i386/cacheinfo.c:3: > ../sysdeps/x86/cacheinfo.c: In function 'init_cacheinfo': > ../sysdeps/x86/cacheinfo.c:762:16: error: unused variable 'eax' [-Werror=unused-variable] > 762 | unsigned int eax; > | ^~~ > cc1: all warnings being treated as errors > > The variable eax in that function is only used inside #ifndef > DISABLE_PREFETCHW, and 32-bit defines DISABLE_PREFETCHW in > sysdeps/i386/cacheinfo.c. This seems to fix it. Okay? 8<------------------------------------------------------------------8< Subject: i386: Remove unused variable in sysdeps/x86/cacheinfo.c Commit a98dc92dd1e278df4c501deb07985018bc2b06de ("x86: Add cache information support for Zhaoxin processors") introduced an unused variable warning in the default i686-linux-gnu build: In file included from ../sysdeps/i386/cacheinfo.c:3: ../sysdeps/x86/cacheinfo.c: In function 'init_cacheinfo': ../sysdeps/x86/cacheinfo.c:762:16: error: unused variable 'eax' [-Werror=unused-variable] 762 | unsigned int eax; | ^~~ ----- sysdeps/x86/cacheinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c index 17d7e41aed..311502dee3 100644 --- a/sysdeps/x86/cacheinfo.c +++ b/sysdeps/x86/cacheinfo.c @@ -759,7 +759,6 @@ __attribute__((constructor)) init_cacheinfo (void) { /* Find out what brand of processor. */ - unsigned int eax; unsigned int ebx; unsigned int ecx; unsigned int edx; @@ -830,6 +829,7 @@ init_cacheinfo (void) #ifndef DISABLE_PREFETCHW if (max_cpuid_ex >= 0x80000001) { + unsigned int eax; __cpuid (0x80000001, eax, ebx, ecx, edx); /* PREFETCHW || 3DNow! */ if ((ecx & 0x100) || (edx & 0x80000000))