public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: "Joseph S. Myers" <jsm28@cam.ac.uk>
Cc: gcc@gcc.gnu.org
Subject: Re: rfc: __builtin_types_compatible_p and unsigned literals
Date: Mon, 06 May 2002 04:16:00 -0000	[thread overview]
Message-ID: <20020506111624.GA3323@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0205061037210.968-100000@kern.srcf.societies.cam.ac.uk>

On Mon, May 06, 2002 at 10:42:08AM +0100, Joseph S. Myers wrote:
> 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?

i'm not sure i follow you.

what i'm referring to, is that i believe the following should all
return true:

	__builtin_types_compatible_p(int, typeof(1))
	__builtin_types_compatible_p(int, typeof(1L))
	__builtin_types_compatible_p(int, typeof(1LL))
	__builtin_types_compatible_p(int, typeof(1U))
	__builtin_types_compatible_p(int, typeof(1ULL))
	__builtin_types_compatible_p(int, typeof(1UL))
	etc

whereas now, these  return false.  they should return true-- after all,
they are *compatible*.

> > 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.)  

perhaps we should return true, like i suggest, but warn with -pedantic??

aldy

  reply	other threads:[~2002-05-06 11:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-05 22:46 Aldy Hernandez
2002-05-06  2:42 ` Joseph S. Myers
2002-05-06  4:16   ` Aldy Hernandez [this message]
2002-05-06  4:25     ` Joseph S. Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020506111624.GA3323@redhat.com \
    --to=aldyh@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jsm28@cam.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).