This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[doc, committed] fix documentation of align type attribute
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 11 Nov 2018 23:29:18 -0700
- Subject: [doc, committed] fix documentation of align type attribute
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.
-Sandra
2018-11-11 Sandra Loosemore <sandra@codesourcery.com>
PR c/69502
gcc/
* doc/extend.texi (Common Type Attributes): For the align type
attribute, copy language about decreasing alignment from the
corresponding variable attribute.
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})