aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2019-08-05 22:40:49 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2019-08-05 16:40:49 -0600
commit75720b3e4544c78464df11cd987b5f60f40d6526 (patch)
tree053fe713ccc3e7a40bbf9d448ebf7b9009f680fa /gcc
parentf9d0ca4043e4c430324a655fdce3f8e4acefe5e3 (diff)
downloadgcc-75720b3e4544c78464df11cd987b5f60f40d6526.zip
gcc-75720b3e4544c78464df11cd987b5f60f40d6526.tar.gz
gcc-75720b3e4544c78464df11cd987b5f60f40d6526.tar.bz2
extend.texi (Common Variable Attributes): Document alias attribute.
gcc/ChangeLog: * doc/extend.texi (Common Variable Attributes): Document alias attribute. From-SVN: r274127
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/doc/extend.texi27
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 99c3669..4f722f8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2019-08-05 Martin Sebor <msebor@redhat.com>
+
+ * doc/extend.texi (Common Variable Attributes): Document alias
+ attribute.
+
2019-08-05 Marek Polacek <polacek@redhat.com>
PR c++/91338 - Implement P1161R3: Deprecate a[b,c].
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 14b232b..254e492 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -6719,6 +6719,33 @@ attributes.
The following attributes are supported on most targets.
@table @code
+
+@item alias ("@var{target}")
+@cindex @code{alias} variable attribute
+The @code{alias} variable attribute causes the declaration to be emitted
+as an alias for another symbol known as an @dfn{alias target}. Except
+for top-level qualifiers the alias target must have the same type as
+the alias. For instance, the following
+
+@smallexample
+int var_target;
+extern int __attribute__ ((alias ("var_target"))) var_alias;
+@end smallexample
+
+@noindent
+defines @code{var_alias} to be an alias for the @code{var_target} variable.
+
+It is an error if the alias target is not defined in the same translation
+unit as the alias.
+
+Note that in the absence of the attribute GCC assumes that distinct
+declarations with external linkage denote distinct objects. Using both
+the alias and the alias target to access the same object is undefined
+in a translation unit without a declaration of the alias with the attribute.
+
+This attribute requires assembler and object file support, and may not be
+available on all targets.
+
@cindex @code{aligned} variable attribute
@item aligned
@itemx aligned (@var{alignment})