Chapter 6. Extensions to the C Language Family
You can also use this attribute on a
parameters with 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.
vector_size (
bytes
This attribute specifies the vector size for the variable, measured in bytes. For example, the
declaration:
int foo __attribute__ ((vector_size (16)));
causes the compiler to set the mode for
ing a 32-bit int (a vector of 4 units of 4 bytes), the corresponding mode of
This attribute is only applicable to integral and float scalars, although arrays, pointers, and func-
tion return values are allowed in conjunction with this construct.
Aggregates with this attribute are invalid, even if they are of the same size as a corresponding
scalar. For example, the declaration:
struct S { int a; };
struct S
__attribute__ ((vector_size (16))) foo;
is invalid even if the size of the structure is the same as the size of the
weak
The
attribute is described in Section 6.26 Declaring Attributes of Functions.
weak
6.33.1. i386 Variable Attributes
Two attributes are currently defined for i386 configurations:
ms_struct
gcc_struct
If
is used on a structure, or if bit-fields are used it may be that the Microsoft ABI packs
packed
them differently than GCC would normally pack them. Particularly when moving packed data
between functions compiled with GCC and the native Microsoft compiler (either via function
call or as data in a file), it may be necessary to access either format.
Currently
-m[no-]ms-bitfields
native Microsoft compiler.
6.34. Specifying Attributes of Types
The keyword
__attribute__
when you define such types. This keyword is followed by an attribute specification inside double
parentheses. Six attributes are currently defined for types:
,
unused
deprecated
6.26 Declaring Attributes of Functions) and for variables (refer to Section 6.33 Specifying Attributes
of Variables).
You may also specify any one of these attributes with
allows you to use these attributes in header files without being concerned about a possible macro of
the same name. For example, you may use
typedef
)
foo
is provided for the Windows X86 compilers to match the
allows you to specify special attributes of
and
. Other attributes are defined for functions (refer to Section
may_alias
__aligned__
for a union data type; then it applies to all function
, to be 16 bytes, divided into
ms_struct
,
aligned
packed
preceding and following its keyword. This
__
instead of
sized units. Assum-
int
will be V4SI.
foo
.
int
and
gcc_struct
and
struct
union
,
transparent_union
.
aligned
151
types
,
Need help?
Do you have a question about the ENTERPRISE LINUX 3 - USING GCC and is the answer not in the manual?
Questions and answers