[doc PATCH] document variable attribute alias
Sandra Loosemore
sandra@codesourcery.com
Mon Aug 5 03:46:00 GMT 2019
On 7/31/19 5:05 PM, Martin Sebor wrote:
> It was pointed out recently in another forum that GCC doesn't
> document attribute alias for variables. It was also noted in
> the same discussion that the semantics of accessing aliases
> and their targets can have "surprising" effects because GCC
> (as do other compilers) assumes that distinct declarations
> with external linkage denote distinct entities.
>
> The attached patch adds text to the manual describing attribute
> alias for variables and pointing out the caveat of accessing
> the same object using both the alias and the target.
>
> Martin
One minor nit:
> +@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
> +
> +defines @code{var_alias} to be an alias for the @code{var_target} variable.
Please use @noindent on the continuation of the sentence after the @end
smallexample.
OK with that fixed.
-Sandra
More information about the Gcc-patches
mailing list