3.4.5. Builtin functions

This section describes the GNU builtin functions that are supported:

__builtin_constant_p function

You can use the builtin function __builtin_constant_p to determine if a value is known to be constant at compile-time. The argument of the function is the value to test. The function returns the integer 1 if the argument is known to be a compile-time constant and 0 if it is not known to be a compile-time constant. A return of 0 does not indicate that the value is not a constant, but that the compiler cannot prove it is a constant with the specified value of the -O option.

int Other_Builtins_2(int a)
{
    const int aconst =10;
    int notconst =20;
    static int aresult ;
    static int notresult;
    aresult= aconst;
    aresult += notconst;

    aresult = __builtin_constant_p (aconst);
    notresult = __builtin_constant_p (notconst);
    return (aresult+notresult);
}

Supported in GNU mode only.

__builtin_frame_address

See Return and frame addresses for details.

__builtin_return_address

See Return and frame addresses for details.

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0205F
Non-Confidential