From patchwork Tue Dec 18 15:18:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 207146 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]) by ozlabs.org (Postfix) with SMTP id 96A352C0080 for ; Wed, 19 Dec 2012 02:19:01 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1356448742; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=cx8Wnlx Lhi8D4IgJQ2AFwAfBlN4=; b=R04f5bIhLiIjaxl/fsJAtv4QkZ1eTTPCI26+AEF NgDUcHNMayGM4e7sdwYYktiuJMRmABAWt5cFmSHlJyEtXfjmjhNmEmYGUlxhcFMX u+PEaQnJki3L/+8WqE3tYoJLNcQAdTdKbfRx6Yzhi00mDA1qOox/O9RUWIGZH81L Zt2k= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=LUDg2OmT0sJhyrwUJ3cqWLpXclCPrBRJlRUkbM0z8YR07oDwRUZrPwRt2rvYvD Q+daNcoQrbTglA65zH9840K488w91tn0P2Qwhc8mjJGDT2y9B/JCsuk0h0F3YrOY QHsbmWuS4epLdApdR6+oxhQDT9sTKD5YPZqBU6BnD2rDw=; Received: (qmail 31126 invoked by alias); 18 Dec 2012 15:18:52 -0000 Received: (qmail 31116 invoked by uid 22791); 18 Dec 2012 15:18:50 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Dec 2012 15:18:15 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBIFIEpW022239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 18 Dec 2012 10:18:15 -0500 Received: from houston.quesejoda.com (vpn-10-149.rdu.redhat.com [10.11.10.149]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qBIFIEF4023583; Tue, 18 Dec 2012 10:18:14 -0500 Message-ID: <50D08935.50506@redhat.com> Date: Tue, 18 Dec 2012 09:18:13 -0600 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Richard Biener CC: gcc-patches Subject: PR other/54324: Do not set __attribute__ for GCC < 3.4 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org As discussed in the thread entitled "allow bootstrapping with older compilers", this patch disallows __attribute__ for GCC < 3.4. Applied as obvious, as you mentioned in the other thread. Thanks. commit 370a6a8ddc628924c1deedf752ea9fc9a058d5cc Author: Aldy Hernandez Date: Tue Dec 18 09:13:48 2012 -0600 PR other/54324 * ansidecl.h (ATTRIBUTE_UNUSED): Do not set __attribute__ for GCC < 3.4. diff --git a/include/ansidecl.h b/include/ansidecl.h index 23d85bf..40f4a5f 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -279,8 +279,15 @@ So instead we use the macro below and test it against specific values. */ # endif #endif +/* Similarly to ARG_UNUSED below. Prior to GCC 3.4, the C++ frontend + couldn't parse attributes placed after the identifier name, and now + the entire compiler is built with C++. */ #ifndef ATTRIBUTE_UNUSED -#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#if GCC_VERSION >= 3004 +# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#else +#define ATTRIBUTE_UNUSED +#endif #endif /* ATTRIBUTE_UNUSED */ /* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the