Type Attributes; I386 Type Attributes; An Inline Function Is As Fast As A Macro - 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

6.35. Type Attributes

6.35.1. i386 Type 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.
To specify multiple attributes, separate them by commas within the double parentheses: for example,
__attribute__ ((aligned (16),packed))

6.36. An Inline Function is As Fast As a Macro

By declaring a function
its callers. This makes execution faster by eliminating the function-call overhead; in addition, if any
of the actual argument values are constant, their known values may permit simplifications at compile
time so that not all of the inline function's code needs to be included. The effect on code size is less
predictable; object code may be larger or smaller with function inlining, depending on the particular
case. Inlining of functions is an optimization and it really "works" only in optimizing compilation. If
you don't use
, no function is really inline.
-O
Inline functions are included in the ISO C99 standard, but there are currently substantial differences
between what GCC implements and what the ISO C99 standard requires.
To declare a function inline, use the
inline int
inc (int *a)
{
(*a)++;
}
(If you are writing a header file to be included in ISO C programs, write
. Refer to Section 6.41 Alternate Keywords.) You can also make all "simple enough" functions
inline
inline with the option
Note that certain usages in a function definition can make it unsuitable for inline substitution. Among
these usages are: use of varargs, use of alloca, use of variable sized data types (refer to Section 6.14
Arrays of Variable Length), use of computed goto (refer to Section 6.3 Labels as Values), use of
nonlocal goto, and nested functions (refer to Section 6.4 Nested Functions). Using
warn when a function marked
failure.
Note that in C and Objective-C, unlike C++, the
function.
GCC automatically inlines member functions defined within the class body of C++ programs even
if they are not explicitly declared
Section 4.5 Options Controlling C++ Dialect.)
is provided for the Windows X86 compilers to match the
, you can direct GCC to integrate that function's code into the code for
inline
inline
-finline-functions
could not be substituted, and will give the reason for the
inline
inline
ms_struct
.
keyword in its declaration, like this:
.
keyword does not affect the linkage of the
inline
. (You can override this with
and
gcc_struct
instead of
__inline__
-Winline
-fno-default-inline
155
will
;

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents