From patchwork Mon Mar 20 17:52:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kang-Che Sung X-Patchwork-Id: 741106 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 3vn3T42R90z9s7R for ; Tue, 21 Mar 2017 04:53:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="eo8tcYwJ"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=wdySqQp5Bcw1RxVOCkItVKiVjRhflkIW9KDQN5gJCv+aMb1+hUuBl gU7ZcYOfak/S6yYs+aXcqBTGp9xtSeA1xXwa/QPYki0QuPjUSru9xoC375ePpwQE oJ/Wk0qmzHdtXLdsQWlhhBKWs1G0Nuj2B82PV+zDN1vx3VDClYhD3s= 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:from:to:cc:subject:date:message-id; s=default; bh=2MDK0x/AwqP62DwQ1wajQKOasAU=; b=eo8tcYwJC9PnMiIfmlfmZM/iGdNN aL9UYe4nKf2UEOHwlUYJMvquDALktcsdrIbykNr6A+OZ6gsO3JZVeD+m/qhYSD+0 mAvhr7gtFMNLweh2FJLJJEIzSpFwuANgoGIe+Xain7aYgGNdJ8YfK49oijpGhR7u AaG0mf/BpF04I0E= Received: (qmail 48468 invoked by alias); 20 Mar 2017 17:53:04 -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 48451 invoked by uid 89); 20 Mar 2017 17:53:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-pf0-f195.google.com 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; bh=O9DxExgMrrWwLbg/ppG0/qk68XxIfmP0JO3sw0iE/ZQ=; b=hPKUvizzeeSawLtPwAUp9QN3+5odGoGgxuBrEJzrEkEYB5kPG3HmwI5IzvdVRGrPZO IYwLE8RyNi5JLODitHUglY+lhMBe8bgdd4y0WEBPNVt6SiCBd2E+mSR8LkSa2pcqmXen CmZRhA3QFKrt6HNOv6Qy2GZ+Mar3OiWsYdKZU6ukrLP1DjVqFfhAS2ZV1DeM5wnztGHx i/3Yv1wvJGbv0SkHsHGEXzR+YV2I2rA5IyFrfvNh9aIPyUyTdqlPoiKnRP/phg4mhElR JxlJctcXN1qG9tZENGQ8bmOE+G4Yn4nA3r4M5wPwbwIE+bchnrGugvFn7HVPQPE2mY7O D66Q== X-Gm-Message-State: AFeK/H2eWa9m7X/xPgdiJn2pegpJFw7cKU5PK6h9fABxVwNNs3LR87KcgyZ17qmYiGp+1A== X-Received: by 10.98.58.7 with SMTP id h7mr34977154pfa.234.1490032381480; Mon, 20 Mar 2017 10:53:01 -0700 (PDT) From: Kang-Che Sung To: libc-alpha@sourceware.org Cc: Kang-Che Sung Subject: [PATCH] Correct __GNUC_PREREQ for __const__ and __noreturn__ attributes. Date: Tue, 21 Mar 2017 01:52:39 +0800 Message-Id: <20170320175239.5982-1-explorer09@gmail.com> Although GCC 2.5 introduced 'const' and 'noreturn' function attributes, the '__const__' and '__noreturn__' were not available until 2.6.2. So check __GNU_PREREQ(2,7) for these. Note: I'm here only to correct an inaccurate info. Because I guess very few people would use such an old compiler now, I'm not bothered to test, nor add support for __attribute__((const)) just for it's sake. * misc/sys/cdefs.h (__attribute_const__): Correct __GNUC_PREREQ to (2,7). (_Noreturn): Likewise. Signed-off-by: Kang-Che Sung --- ChangeLog | 6 ++++++ misc/sys/cdefs.h | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 578714c4fb..e0ddc4497f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-03-21 Kang-Che Sung + + * misc/sys/cdefs.h (__attribute_const__): Correct __GNUC_PREREQ + to (2,7). + (_Noreturn): Likewise. + 2017-03-20 Mike Frysinger [BZ #21275] diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index b03ebda22f..d040f72b70 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -221,8 +221,10 @@ # define __attribute_pure__ /* Ignore */ #endif -/* This declaration tells the compiler that the value is constant. */ -#if __GNUC_PREREQ (2,5) +/* This declaration tells the compiler that the value is constant. + Although `const' attribute was introduced in gcc 2.5, we need at least + gcc 2.6.2 for the `__const__' name. */ +#if __GNUC_PREREQ (2,7) # define __attribute_const__ __attribute__ ((__const__)) #else # define __attribute_const__ /* Ignore */ @@ -398,7 +400,9 @@ #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && !__GNUC_PREREQ (4,7)) -# if __GNUC_PREREQ (2,8) +/* Although `noreturn' attribute was introduced in gcc 2.5, we need at least + gcc 2.6.2 for the `__noreturn__' name. */ +# if __GNUC_PREREQ (2,7) # define _Noreturn __attribute__ ((__noreturn__)) # else # define _Noreturn