From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10154 invoked by alias); 6 May 2002 11:16:31 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 10093 invoked from network); 6 May 2002 11:16:26 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 6 May 2002 11:16:26 -0000 Received: from taarna.cygnus.com (taarna.sfbay.redhat.com [205.180.230.102]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id EAA24157; Mon, 6 May 2002 04:16:25 -0700 (PDT) Received: (aldyh@localhost) by taarna.cygnus.com (SMI-8.6/8.6.4) id EAA04924; Mon, 6 May 2002 04:16:24 -0700 Date: Mon, 06 May 2002 04:16:00 -0000 From: Aldy Hernandez To: "Joseph S. Myers" Cc: gcc@gcc.gnu.org Subject: Re: rfc: __builtin_types_compatible_p and unsigned literals Message-ID: <20020506111624.GA3323@redhat.com> Reply-To: aldyh@redhat.com References: <20020506034729.GA18128@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-SW-Source: 2002-05/txt/msg00378.txt.bz2 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