From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31891 invoked by alias); 16 Jul 2005 11:49:13 -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 31879 invoked by uid 22791); 16 Jul 2005 11:49:10 -0000 Received: from vinc17.net4.nerim.net (HELO ay.vinc17.org) (62.212.121.106) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 16 Jul 2005 11:49:10 +0000 Received: from lefevre by ay.vinc17.org with local (Exim 4.50) id 1DtlAH-0008EG-MQ; Sat, 16 Jul 2005 13:49:05 +0200 Date: Sat, 16 Jul 2005 11:49:00 -0000 From: Vincent Lefevre To: gcc@gcc.gnu.org Cc: Dave Korn , 'Daniel Berlin' , mrc.lrn@inwind.it Subject: Re: Pointers in comparison expressions Message-ID: <20050716114905.GG18430@ay.vinc17.org> Mail-Followup-To: gcc@gcc.gnu.org, Dave Korn , 'Daniel Berlin' , mrc.lrn@inwind.it References: <1121185961.13154.50.camel@linux-009002219143> <20050712214222.GA90111@falcon.midgard.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20050712214222.GA90111@falcon.midgard.homeip.net> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.9-vl-20050705i X-SW-Source: 2005-07/txt/msg00655.txt.bz2 On 2005-07-12 23:42:23 +0200, Erik Trulsson wrote: > Pointer subtraction is only well defined if both pointers point to > elements in the same array (or one past the end of the array). I don't know what you mean by "well defined", but even in this case, the behavior can be undefined. So, replacing a < b by a - b < 0 is not guaranteed to work with every implementation, just like with integers. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / SPACES project at LORIA