[Bug web/13161] New: Documentation update "Specifying Attributes of Variables"
eddy at klopper dot net
gcc-bugzilla@gcc.gnu.org
Sat Nov 22 16:47:00 GMT 2003
I found the documentation unclear on how to specify attributes of member
functions. Propose the following patch, or something similar (the example could
be extended to include an unused variable), to clarify not only _how_, but that
it is in fact possible.
--- original/gcc.info 2003-10-16 21:23:50.000000000 +0200
+++ edited/gcc.info 2003-11-22 17:31:14.000000000 +0100
@@ -13423,9 +13423,16 @@
that type.
`unused'
- This attribute, attached to a variable, means that the variable is
- meant to be possibly unused. GCC will not produce a warning for
- this variable.
+ This attribute, attached to a variable or parameter, means that it is
+ meant to be possibly unused. GCC will not produce a warning for this
+ variable or parameter. For example:
+
+ bool A::f(__attribute__((unused)) State& state, char ch)
+ {
+ return ch > 127;
+ }
+
+ informs the compiler not to issue an unused parameter warning for `state'
`vector_size (BYTES)'
This attribute specifies the vector size for the variable,
--
Summary: Documentation update "Specifying Attributes of
Variables"
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: web
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: eddy at klopper dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: n/a
GCC host triplet: n/a
GCC target triplet: n/a
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13161
More information about the Gcc-bugs
mailing list