From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5715 invoked by alias); 26 Feb 2002 04:49:47 -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 5617 invoked from network); 26 Feb 2002 04:49:42 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 26 Feb 2002 04:49:42 -0000 Received: from drow by nevyn.them.org with local (Exim 3.34 #1 (Debian)) id 16fZYa-0000gY-00; Mon, 25 Feb 2002 23:49:40 -0500 Date: Mon, 25 Feb 2002 21:10:00 -0000 From: Daniel Jacobowitz To: Aldy Hernandez Cc: Daniel Egger , GCC Developer Mailinglist , Joseph Myers Subject: Re: builtin_types_compatible_p and const Message-ID: <20020225234940.A2567@nevyn.them.org> Mail-Followup-To: Aldy Hernandez , Daniel Egger , GCC Developer Mailinglist , Joseph Myers References: <1014644318.4393.2.camel@sonja> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i X-SW-Source: 2002-02/txt/msg01537.txt.bz2 On Tue, Feb 26, 2002 at 10:45:04AM +1100, Aldy Hernandez wrote: > > On Tuesday, February 26, 2002, at 12:38 AM, Daniel Egger wrote: > > >Am Mon, 2002-02-25 um 03.03 schrieb Aldy Hernandez: > > > >>first, vec_lvsl accepts "char *" not "const char *", so you'll > >>have to cast. > > > >That's about the most annoying thing. What's wrong about loading > >from a constant address? > > i agree, let's summon the expert again... > > joseph, i agree with daniel. the code below should compile, but > x and y are not compatible according to the builtin. are there > any objections to making a patch to fix this? > > const char *x; > char *y; > int foo[__builtin_types_compatible_p (__typeof(x), __typeof(y)) == 1 ? > 1 : -1]; Two things: - at that point, you're not really dealing with type compatibility any more. They aren't compatible as I understand it; but under default promotions they can be. - You then need to distinguish the arguments to __builtin_close_enough_p or whatever it becomes. __builtin_close_enough_p (const char *, char *) may be OK, but what about: __builtin_close_enough_p (char *, const char *) -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer