This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: new __builtin_choose_type (patch)
- To: Aldy Hernandez <aldyh at redhat dot com>
- Subject: Re: new __builtin_choose_type (patch)
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Tue, 2 Oct 2001 20:04:48 +0100 (BST)
- cc: <gcc at gcc dot gnu dot org>
On 2 Oct 2001, Aldy Hernandez wrote:
> it was suggested to have a builtin analogous to the ?: operator that
> will work as follows:
>
> __builtin_choose_type (exp0, type, exp1, exp2);
>
> if <exp0> is of type <type>, evaluate <exp1> else evaluate <exp2>.
>
> i have a patch for this feature and i'd like some comments.
Since your patch doesn't add documentation or testcases, I don't know what
it really intends. In a case like this, the documentation and the
testcases are more useful for people to comment on than the code patch,
and can usefully be written first.
What is the return type of the builtin? What is the return value? Do the
default argument promotions get applied to the arguments of it? (Anything
that applies the default argument promotions is unsuitable for <tgmath.h>,
where float must be handled differently from double; whereas types such as
char which are subject to the integer promotions don't matter here.)
--
Joseph S. Myers
jsm28@cam.ac.uk