4.7.3. __builtin_constant_p

This builtin function determines if a value is known to be constant at compile-time.


This builtin function is a GNU compiler extension that is supported by the ARM compiler.


Supported in GNU mode only.


int __builtin_constant_p(...)



is the argument whose value is to be tested.

Return value

__builtin_constant_p 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 value 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.

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A