[doc,committed] fix documentation of align type attribute

Message ID df7eb9c7-9bce-15c7-4c0a-b9abb01bfce0@codesourcery.com
State New
Headers show
  • [doc,committed] fix documentation of align type attribute
Related show

Commit Message

Sandra Loosemore Nov. 12, 2018, 6:29 a.m.
PR69502 notes that the documentation of the align type attribute had 
gotten out of sync with the corresponding variable attribute with 
respect to whether decreasing the alignment of a type was permitted. 
I've checked in this patch to replace the incorrect paragraph with a 
copy of the correct one.



Index: gcc/doc/extend.texi
--- gcc/doc/extend.texi	(revision 266023)
+++ gcc/doc/extend.texi	(working copy)
@@ -7101,8 +7101,11 @@  up to a maximum of 8-byte alignment, the
 in an @code{__attribute__} still only provides you with 8-byte
 alignment.  See your linker documentation for further information.
-The @code{aligned} attribute can only increase alignment.  Alignment
-can be decreased by specifying the @code{packed} attribute.  See below.
+When used on a struct, or struct member, the @code{aligned} attribute can
+only increase the alignment; in order to decrease it, the @code{packed}
+attribute must be specified as well.  When used as part of a typedef, the
+@code{aligned} attribute can both increase and decrease alignment, and
+specifying the @code{packed} attribute generates a warning.
 @cindex @code{warn_if_not_aligned} type attribute
 @item warn_if_not_aligned (@var{alignment})