From patchwork Tue Apr 29 09:07:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 745 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (peon2454.g.dreamhost.com [208.113.200.127]) by wilcox.dreamhost.com (Postfix) with ESMTP id C2F1D360078 for ; Tue, 29 Apr 2014 02:07:47 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14307373) id 6C1AB13A5E05; Tue, 29 Apr 2014 02:07:47 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx21.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx21.g.dreamhost.com (Postfix) with ESMTPS id 3BD9D14A5A54 for ; Tue, 29 Apr 2014 02:07:47 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; q=dns; s=default; b=IQ0 wndZX1uj4EfxL0+MWKeiA7cb0AEsDrslbQ13PE+VB3sHiU4G1DnrEGGvET9DRbin vHaciJk4HGoGOk2Afc8a6vEv2H2xUtBSoeXQvlo4Xw8iM7+q4e5XpTL4w6rvPA3H dd+kXEtIAl9LWr1rL0bY+Mz24+0N1g70VxUlf4Fc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; s=default; bh=bJsBm7fWx nvI0jCosOy55aEAcac=; b=Gdw2KKicdBZURkvTxKIri2vhSvFx9i403prnvOeZA lM3TIAvKUHHVJGOzH0B8AU6iuCKE5t/+imd4SLWk7QD7+t2/wWYgq1zlX6s99EyI 1dG5lac94wSt+n5C5o8aDT1Jp2jOlLqJY6QIRyiYwynUDI/bt98XPdQ1FtckcWpY Ww= Received: (qmail 29631 invoked by alias); 29 Apr 2014 09:07:45 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 29619 invoked by uid 89); 29 Apr 2014 09:07:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Message-ID: <535F6BDE.3050801@redhat.com> Date: Tue, 29 Apr 2014 05:07:42 -0400 From: "Carlos O'Donell" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: GNU C Library Subject: [PATCH] Fix -Wundef for FEATURE_INDEX_1. X-DH-Original-To: glibc@patchwork.siddhesh.in While reviewing some code for Siddhesh and waiting for a build I had time to do another -Wundef fix. This is the simplest patch I can come up with to fix FEATURE_INDEX_1 -Wundef warnings. The constant definition is duplicated because we can't use the enum constant in assembly nor in the other macros. The bright side is that we end up with: #ifdef __ASSEMBLER__ ... Everything we need for assembly. #endif ... Everything we need for non-assembly. #endif The down side is the slight duplication. I considered adding another macro e.g. #define __FEATURE_INDEX_1 0 ... # define FEATURE_INDEX_1 __FEATURE_INDEX_1 ... However, that just seemed ugly, so I left the duplication. Any objections? 2014-04-29 Carlos O'Donell * sysdeps/x86_64/multiarch/init-arch.h [__ASSEMBLER__]: Define FEATURE_INDEX_1 to 0. [!__ASSEMBLER__]: Likewise. --- Cheers, Carlos. diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h index 813b6de..6449109 100644 --- a/sysdeps/x86_64/multiarch/init-arch.h +++ b/sysdeps/x86_64/multiarch/init-arch.h @@ -49,6 +49,11 @@ #ifdef __ASSEMBLER__ +/* The feature index constants must match those used in the non-assembly + below. We can't use a unified definition because the assembly won't + accept enum constants, nor will other macros. */ +# define FEATURE_INDEX_1 0 + # include # define index_SSE2 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_EDX_OFFSET @@ -85,6 +90,7 @@ enum enum { FEATURE_INDEX_1 = 0, +# define FEATURE_INDEX_1 0 /* Keep the following line at the end. */ FEATURE_INDEX_MAX };