From patchwork Fri Mar 11 22:46:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 86462 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 F168DB6F83 for ; Sat, 12 Mar 2011 09:46:14 +1100 (EST) Received: (qmail 7753 invoked by alias); 11 Mar 2011 22:46:09 -0000 Received: (qmail 7737 invoked by uid 22791); 11 Mar 2011 22:46:08 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_SV, 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; Fri, 11 Mar 2011 22:46:03 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2BMk2Ki018849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 11 Mar 2011 17:46:02 -0500 Received: from [127.0.0.1] (ovpn-113-58.phx2.redhat.com [10.3.113.58]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2BMk1lk019470 for ; Fri, 11 Mar 2011 17:46:02 -0500 Message-ID: <4D7AA629.6020404@redhat.com> Date: Fri, 11 Mar 2011 17:46:01 -0500 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: gcc-patches List Subject: Re: PATCH to attribute_takes_identifier_p for c++/46803 References: <4D7A95A6.8060605@redhat.com> In-Reply-To: <4D7A95A6.8060605@redhat.com> 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 On 03/11/2011 04:35 PM, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu, applied to trunk. Hmm, I thought bootstrap used -Werror, but I just noticed some build warnings from this change. Fixed thus. commit 9bf1c74e01512f43f764c9a4d437f9d999b74117 Author: jason Date: Fri Mar 11 22:38:58 2011 +0000 * attribs.c (lookup_attribute_spec): Take const_tree. * tree.h: Adjust. * c-family/c-common.c (attribute_takes_identifier_p): Add missing const. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170887 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/attribs.c b/gcc/attribs.c index d8daa6f..fee1499 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -208,7 +208,7 @@ register_attribute (const struct attribute_spec *attr) /* Return the spec for the attribute named NAME. */ const struct attribute_spec * -lookup_attribute_spec (tree name) +lookup_attribute_spec (const_tree name) { struct substring attr; diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 32b9a70..4da9a2d 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -5665,7 +5665,7 @@ c_init_attributes (void) bool attribute_takes_identifier_p (const_tree attr_id) { - struct attribute_spec *spec = lookup_attribute_spec (attr_id); + const struct attribute_spec *spec = lookup_attribute_spec (attr_id); if (spec == NULL) /* Unknown attribute that we'll end up ignoring, return true so we don't complain about an identifier argument. */ diff --git a/gcc/tree.h b/gcc/tree.h index 296e6de..2a94b3a 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -5348,7 +5348,7 @@ extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, const_tree); /* In attribs.c. */ -extern const struct attribute_spec *lookup_attribute_spec (tree); +extern const struct attribute_spec *lookup_attribute_spec (const_tree); /* Process the attributes listed in ATTRIBUTES and install them in *NODE, which is either a DECL (including a TYPE_DECL) or a TYPE. If a DECL,