Red Hat ENTERPRISE LINUX 3 - USING GCC Using Instructions page 155

Using the gnu compiler collection (gcc)
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING GCC:
Table of Contents

Advertisement

Chapter 6. Extensions to the C Language Family
If
-fexceptions
that happens during the processing of the exception. Note that the
allow the exception to be caught, only to perform an action. It is undefined what happens if
cleanup_function
common
nocommon
The
attribute requests GCC to place a variable in "common" storage. The
common
attribute requests the opposite - to allocate space for it directly.
These attributes override the default chosen by the
tively.
deprecated
The
deprecated
This is useful when identifying variables that are expected to be removed in a future version of a
program. The warning also includes the location of the declaration of the deprecated variable, to
enable users to easily find further information about why the variable is deprecated, or what they
should do instead. Note that the warnings only occurs for uses:
extern int old_var __attribute__ ((deprecated));
extern int old_var;
int new_fn () { return old_var; }
results in a warning on line 3 but not line 2.
The
deprecated
ing Attributes of Functions, Section 6.34 Specifying Attributes of Types.)
mode (
)
mode
This attribute specifies the data type for the declaration--whichever type corresponds to the mode
. This in effect lets you request an integer or floating point type according to its width.
mode
You may also specify a mode of
a one-byte integer,
for the mode used to represent pointers.
__pointer__
packed
The
attribute specifies that a variable or structure field should have the smallest possible
packed
alignment--one byte for a variable, and one bit for a field, unless you specify a larger value with
the
attribute.
aligned
Here is a structure in which the field
struct foo
{
char a;
int x[2] __attribute__ ((packed));
};
section ("
section-name
Normally, the compiler places the objects it generates in sections like
times, however, you need additional sections, or you need certain particular variables to appear
in special sections, for example to map to special hardware. The
a variable (or function) lives in a particular section. For example, this small program uses several
specific section names:
struct duart a __attribute__ ((section ("DUART_A"))) = { 0 };
struct duart b __attribute__ ((section ("DUART_B"))) = { 0 };
char stack[10000] __attribute__ ((section ("STACK"))) = { 0 };
int init_data __attribute__ ((section ("INITDATA"))) = 0;
is enabled, then
cleanup_function
does not return normally.
attribute results in a warning if the variable is used anywhere in the source file.
attribute can also be used for functions and types (refer to Section 6.26 Declar-
byte
or
word
__word__
is packed, so that it immediately follows
x
")
will be run during the stack unwinding
-fno-common
or
to indicate the mode corresponding to
__byte__
for the mode of a one-word integer, and
attribute does not
cleanup
and
flags respec-
-fcommon
pointer
:
a
and
data
bss
attribute specifies that
section
149
nocommon
or
. Some-

Advertisement

Table of Contents
loading
Need help?

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

This manual is also suitable for:

Enterprise linux 3

Table of Contents