From patchwork Thu Dec 9 21:23:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 74991 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 C4F5EB6F1E for ; Fri, 10 Dec 2010 08:23:52 +1100 (EST) Received: (qmail 28323 invoked by alias); 9 Dec 2010 21:23:51 -0000 Received: (qmail 28302 invoked by uid 22791); 9 Dec 2010 21:23:49 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Dec 2010 21:23:44 +0000 Received: (qmail 21241 invoked from network); 9 Dec 2010 21:23:42 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Dec 2010 21:23:42 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1PQnxk-00009o-NZ; Thu, 09 Dec 2010 21:23:40 +0000 Date: Thu, 9 Dec 2010 21:23:40 +0000 (UTC) From: "Joseph S. Myers" To: "hjl.tools at gmail dot com" cc: gcc-patches@gcc.gnu.org Subject: Re: [Bug c/46859] Attribute depends on location In-Reply-To: Message-ID: References: MIME-Version: 1.0 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 Thu, 9 Dec 2010, hjl.tools at gmail dot com wrote: > For > > int * > __attribute__((aligned(4096))) > foo2 () > { > return 0; > } > > parser applies attribute to "int *" instead of foo2. Yes, this is as documented, just like if you had a type qualifier there. I see that two critical words were missing in the relevant section of the manual; I've applied this patch to add them. Index: doc/extend.texi =================================================================== --- doc/extend.texi (revision 167663) +++ doc/extend.texi (working copy) @@ -4036,7 +4036,7 @@ declaration @code{T D} specifies the type ``@var{derived-declarator-type-list} @var{Type}'' for @var{ident}, then @code{T D1} specifies the type ``@var{derived-declarator-type-list} -@var{type-qualifier-and-attribute-specifier-list} @var{Type}'' for +@var{type-qualifier-and-attribute-specifier-list} pointer to @var{Type}'' for @var{ident}. For example, Index: ChangeLog =================================================================== --- ChangeLog (revision 167663) +++ ChangeLog (working copy) @@ -1,5 +1,10 @@ 2010-12-09 Joseph Myers + * doc/extend.texi (Attribute Syntax): Correct description of + attributes in pointer declarators. + +2010-12-09 Joseph Myers + * config/mips/vxworks.h (DBX_REGISTER_NUMBER): Undefine. * config.gcc (mips64*-*-linux* | mipsisa64*-*-linux*, mips*-*-linux*, mips-wrs-vxworks): Don't use svr4.h.