public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [Bug c/46859] Attribute depends on location
       [not found] ` <bug-46859-4-mX1oKfkLyH@http.gcc.gnu.org/bugzilla/>
@ 2010-12-09 21:35   ` Joseph S. Myers
  0 siblings, 0 replies; only message in thread
From: Joseph S. Myers @ 2010-12-09 21:35 UTC (permalink / raw)
  To: hjl.tools at gmail dot com; +Cc: gcc-patches

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  <joseph@codesourcery.com>
 
+	* doc/extend.texi (Attribute Syntax): Correct description of
+	attributes in pointer declarators.
+
+2010-12-09  Joseph Myers  <joseph@codesourcery.com>
+
 	* config/mips/vxworks.h (DBX_REGISTER_NUMBER): Undefine.
 	* config.gcc (mips64*-*-linux* | mipsisa64*-*-linux*,
 	mips*-*-linux*, mips-wrs-vxworks): Don't use svr4.h.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-09 21:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-46859-4@http.gcc.gnu.org/bugzilla/>
     [not found] ` <bug-46859-4-mX1oKfkLyH@http.gcc.gnu.org/bugzilla/>
2010-12-09 21:35   ` [Bug c/46859] Attribute depends on location Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).