int __builtin_constant_p (exp)
是GCC内置函数
功能:
— Built-in Function: int __builtin_constant_p (exp)
You can use the built-in function __builtin_constant_p
todetermine if a value is known to be constant at compile time and hencethat GCC can perform constant-folding on expressions involving thatvalue. The argument of the function is the value to test. The functionreturns the integer 1 if the argument is known to be a compile-timeconstant and 0 if it is not known to be a compile-time constant. Areturn of 0 does not indicate that the value is not a constant,but merely that GCC cannot prove it is a constant with the specifiedvalue of the -O option.
也就是说在编译时,只要exp参数是常数,就返回1,否则返回0.