From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aldy Hernandez To: Stan Shebs Cc: Magnus Fromreide , gcc@gcc.gnu.org Subject: Re: new __builtin_choose_type (patch) (newbuiltin_equal_types patch) Date: Wed, 03 Oct 2001 20:37:00 -0000 Message-id: <1002166811.24557.185.camel@culebra.cygnus.com> References: <1002165585.31345.173.camel@culebra.cygnus.com> <3BBBD7E9.25F6DDF7@apple.com> X-SW-Source: 2001-10/msg00216.html On Wed, 2001-10-03 at 23:30, Stan Shebs wrote: > Aldy Hernandez wrote: > > > > On Wed, 2001-10-03 at 04:15, Magnus Fromreide wrote: > > > It is my feeling that it would be more general and cleaner to do something > > > along the lines of > > > > > > _Bool __builtin_equal_types(arg|type, arg|type) > > > > > > that doesn't evaluate the arguments if they are expressions and answers > > > the question of wether they are of the same type. > > > > > > Usage examples: > > > > > > __builtin_equal_types(x, y) ? no() : x = 10; > > > if(__builtin_equal_types(x, y)) > > > { > > > } > > > else > > > { > > > } > > > > thought about it. like it. nice and clean. > > > > is everyone ok with this approach? it's pretty. it's got > > documentation. it's got a test case. :) > > Doesn't your patch still have the char->int promotion problem? > What does _builtin_equal_types(ch, i) return for variables that > are char and int, respectively? seems to be working now. so i guess it's ready for approval :) > > Also, in honor of GCC's Lispy origins, it should be called > __builtin_equal_types_p . (Just kidding!) :) > > Stan -- Aldy Hernandez E-mail: aldyh@redhat.com Professional Gypsy on a Motorcycle Red Hat, Inc.