Red Hat ENTERPRISE LINUX 4 Manual page 219

Hide thumbs Also See for ENTERPRISE LINUX 4:
Table of Contents

Advertisement

Chapter 6. Extensions to the C Language Family
GCC provides built-in versions of the ISO C99 floating point comparison macros that avoid raising
exceptions for unordered operands. They have the same names as the standard macros (
,
isgreaterequal
prefixed. We intend for a library implementor to be able to simply
__builtin_
standard macro to its built-in equivalent.
int
__builtin_types_compatible_p
__builtin_types_compatible_p
This built-in function returns 1 if the unqualified versions of the types
types, not expressions) are compatible, 0 otherwise. The result of this built-in function can be used in
integer constant expressions.
This built-in function ignores top level qualifiers (e.g.,
alent to
.
const int
The type
and
int[]
even if the size of their types, on the particular architecture are the same. Also, the amount of pointer
indirection is taken into account when determining similarity. Consequently,
to
. Furthermore, two types that are typedefed are considered compatible if their underlying
short **
types are compatible.
An
type is not considered to be compatible with another
enum
with the same integer type; this is what the C standard specifies. For example,
not similar to
enum {hot, dog}
You would typically use this function in code whose execution varies depending on the arguments'
types. For example:
#define foo(x)
({
typeof (x) tmp;
if (__builtin_types_compatible_p (typeof (x), long double)) \
tmp = foo_long_double (tmp);
else if (__builtin_types_compatible_p (typeof (x), double)) \
tmp = foo_double (tmp);
else if (__builtin_types_compatible_p (typeof (x), float))
tmp = foo_float (tmp);
else
abort ();
tmp;
})
Note: This construct is only available for C.
type__builtin_choose_expr
__builtin_choose_expr
built-in function returns
determined at compile time, is nonzero. Otherwise it returns 0.
This built-in function is analogous to the
its type unaltered by promotion rules. Also, the built-in function does not evaluate the expression that
was not chosen. For example, if
side-effects.
This built-in function can return an lvalue if the chosen argument is an lvalue.
If
is returned, the return type is the same as
exp1
type is the same as
exp2
Example:
,
isless
islessequal
to determine whether two types are the same.
are compatible. On the other hand,
int[5]
.
(
const_exp
to evaluate code depending on the value of a constant expression. This
if
exp1
const_exp
const_exp
.
,
islessgreater
(
,
) You can use the built-in function
type1
type2
,
const
volatile
enum
,
,
exp1
exp2
, which is a constant expression that must be able to be
operator in C, except that the expression returned has
? :
evaluates to true,
's type. Similarly, if
exp1
, and
isunordered
and
type1
type2
). For example,
and
are not compatible,
int
char *
short *
type even if both are compatible
enum {foo, bar}
) You can use the built-in function
is not evaluated even if it has
exp2
is returned, its return
exp2
211
,
isgreater
) , with
each
#define
(which are
is equiv-
int
is not similar
is
\
\
\
\
\
\
\
\
\
\

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 4 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents