This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: builtin_constant_p


> So you are saying that side-effects should not be performed?  Why?

AFAIK, the common usage pattern for this is

#define foo(x)  builtin_constant_p(x) ? \
                superfast_foo_requiring_constants(x) : generic_foo(x)

in which case you'd like to get the side effects only once. In effect,
I'd consider builtin_constant_p to be in a category of sizeof and
typeof, not like a function.

Regards,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]