Attribute Syntax - Red Hat ENTERPRISE LINUX 3 - USING GCC Using Instructions

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
Section 4.17.2 IBM RS/6000 and PowerPC Options, for more information on when long calls are
and are not necessary.
interrupt
Use this attribute on the C4x ports to indicate that the specified function is an interrupt handler.
The compiler will generate function entry and exit sequences suitable for use in an interrupt
handler when this attribute is present.
void f () __attribute__ ((interrupt ("IRQ")));
Permissible values for this parameter are: IRQ, FIQ, SWI, ABORT and UNDEF.
naked
Use this attribute on the C4x and IP2K ports to indicate that the specified function do not need
prologue/epilogue sequences generated by the compiler. It is up to the programmer to provide
these sequences.
far
On 68HC11 and 68HC12 the
that takes care of switching memory banks when entering and leaving a function. This calling
convention is also the default when using the
On 68HC12 the compiler will use the
tion.
On 68HC11 the compiler will generate a sequence of instructions to invoke a board-specific
routine to switch the memory bank and call the real function. The board-specific routine simulates
a
. At the end of a function, it will jump to a board-specific routine instead of using
call
The board-specific return routine simulates the
near
On 68HC11 and 68HC12 the
convention based on
-mlong-calls
You can specify multiple attributes in a declaration by separating them by commas within the double
parentheses or by immediately following an attribute declaration with another attribute declaration.
Some people object to the
instead. At the time
__attribute__
1. It is impossible to generate
2. There is no telling what the same
These two reasons applied to almost any application that might have been proposed for
was basically a mistake to use
The ISO C99 standard includes
In addition, a
#pragma GCC
been found convenient to use
corresponding declarations, whereas
part of the grammar. .

6.27. Attribute Syntax

This section describes the syntax with which
which attribute specifiers bind, for the C language. Some details may vary for C++ and Objective-C.
attribute causes the compiler to use a calling convention
far
near
and
. This attribute can be used to cancel the effect of the
jsr
rts
option.
__attribute__
was designed, there were two reasons for not doing this.
#pragma
#pragma
for anything.
#pragma
, which now allows pragmas to be generated from macros.
_Pragma
namespace is now in use for GCC-specific pragmas. However, it has
__attribute__
#pragma GCC
-mlong-calls
and
instructions to call and return from a func-
call
rtc
.
rtc
attribute causes the compiler to use the normal calling
feature, suggesting that ISO C's
commands from a macro.
might mean in another compiler.
to achieve a natural attachment of attributes to their
is of use for constructs that do not naturally form
__attribute__
option.
#pragma
may be used, and the constructs to
143
.
rts
should be used
. It
#pragma

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