I've checked in this patch which fixes another long-standing documentation issue in bugzilla. Here there was a missing entry for __attribute__((visibility ("protected"))) (or whatever) in the section on variable attributes, although there was an example showing its use on a variable in the function attributes section. I also did confirm that the attribute does work on variables.

-Sandra

2015-11-17  Sandra Loosemore  <san...@codesourcery.com>

	PR 48568
	* doc/extend.texi (Common Function Attributes) [visibility]:
	Add cross-references to matching variable and type attributes.
	(Common Variable Attributes) [visibility]: Add missing entry.
Index: gcc/doc/extend.texi
===================================================================
--- gcc/doc/extend.texi	(revision 230497)
+++ gcc/doc/extend.texi	(working copy)
@@ -3216,6 +3216,9 @@ class itself is instantiated.
 @item visibility ("@var{visibility_type}")
 @cindex @code{visibility} function attribute
 This attribute affects the linkage of the declaration to which it is attached.
+It can be applied to variables (@pxref{Common Variable Attributes}) and types
+(@pxref{Common Type Attributes}) as well as functions.
+
 There are four supported @var{visibility_type} values: default,
 hidden, protected or internal visibility.
 
@@ -5660,6 +5663,12 @@ struct S  __attribute__ ((vector_size (1
 is invalid even if the size of the structure is the same as the size of
 the @code{int}.
 
+@item visibility ("@var{visibility_type}")
+@cindex @code{visibility} variable attribute
+This attribute affects the linkage of the declaration to which it is attached.
+The @code{visibility} attribute is described in
+@ref{Common Function Attributes}.
+
 @item weak
 @cindex @code{weak} variable attribute
 The @code{weak} attribute is described in

Reply via email to