This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: builtin_constant_p
- To: wilson at cygnus dot com
- Subject: Re: builtin_constant_p
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Thu, 25 Jun 1998 00:30:14 +0200
- CC: rth at cygnus dot com, law at cygnus dot com, egcs-patches at cygnus dot com
- References: <199806241939.MAA14463@rtl.cygnus.com>
> 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