This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rfc: __builtin_types_compatible_p and unsigned literals
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Mon, 6 May 2002 10:42:08 +0100 (BST)
- Subject: Re: rfc: __builtin_types_compatible_p and unsigned literals
On Mon, 6 May 2002, Aldy Hernandez wrote:
> for example,
>
> int foo (unsigned int blah) { }
>
> accepts foo(31) as well as foo(31U).
It also accepts foo(31LL) and other such implicitly convertible types, if
the prototype is in scope. Or are you referring to the special case where
a prototype isn't in scope (and for variable arguments), and
signed/unsigned can be mixed provided the value is representable in both
types?
> can i "fix" __builtin_types_compatible_p?
The types aren't compatible. (Pointers to them aren't even implictly
convertible, though you'll need -pedantic to get a warning about that.)
Making the specification more complicated and less representative of the
name of the built-in function seems dubious.
--
Joseph S. Myers
jsm28@cam.ac.uk