From patchwork Wed Jul 2 20:04:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 1860 Received: (qmail 32002 invoked by alias); 2 Jul 2014 20:02: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 31970 invoked by uid 89); 2 Jul 2014 20:02:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Thu, 3 Jul 2014 01:34:09 +0530 From: Siddhesh Poyarekar To: Roland McGrath Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] Fix Wundef warning for __STDC_VERSION__ Message-ID: <20140702200408.GT20796@spoyarek.pnq.redhat.com> References: <20140702185850.GR20796@spoyarek.pnq.redhat.com> <20140702195102.661BA2C397B@topped-with-meat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140702195102.661BA2C397B@topped-with-meat.com> User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) On Wed, Jul 02, 2014 at 12:51:02PM -0700, Roland McGrath wrote: > > -#if !defined _Noreturn && __STDC_VERSION__ < 201112 && !__GNUC_PREREQ (4,7) > > +#if (!defined _Noreturn && defined __STDC_VERSION__ \ > > + && __STDC_VERSION__ < 201112 && !__GNUC_PREREQ (4,7)) > > I think this wants to be: > > #if (!defined _Noreturn \ > && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ > && !__GNUC_PREREQ (4,7)) > Ugh, of course. This is what I've queued up to check in. Siddhesh commit 80b58571d2c5de23049e55d87c881ea6c9423dfd Author: Siddhesh Poyarekar Date: Thu Jul 3 01:32:17 2014 +0530 Fix Wundef warning for __STDC_VERSION__ c4c4124473c187b5c4642611390897666c3d3970 added the _Noreturn macro for pre-C11 compilers, but it now throws a new Wundef warning during `make check` for __STDC_VERSION__ which gcc does not define by default. The following patch fixes this in line with other uses of __STDC_VERSION__ in the file. diff --git a/ChangeLog b/ChangeLog index 7b33604..049de91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-07-02 Roland McGrath + + * misc/sys/cdefs.h: Check if __STDC_VERSION__ is defined + before checking its value. + 2014-07-02 Siddhesh Poyarekar * intl/loadmsgcat.c (_nl_load_domain): Use __builtin_expect. diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index a5c3224..04db956 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -382,7 +382,9 @@ # define __glibc_likely(cond) (cond) #endif -#if !defined _Noreturn && __STDC_VERSION__ < 201112 && !__GNUC_PREREQ (4,7) +#if (!defined _Noreturn \ + && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ + && !__GNUC_PREREQ (4,7)) # if __GNUC_PREREQ (2,8) # define _Noreturn __attribute__ ((__noreturn__)) # else