From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13117 invoked by alias); 28 Jun 2005 19:17:52 -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 13104 invoked by uid 22791); 28 Jun 2005 19:17:48 -0000 Received: from dspnet.fr.eu.org (HELO dspnet.fr.eu.org) (213.186.44.138) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 28 Jun 2005 19:17:48 +0000 Received: by dspnet.fr.eu.org (Postfix, from userid 1007) id 7E7B934D2D; Tue, 28 Jun 2005 21:17:46 +0200 (CEST) Date: Tue, 28 Jun 2005 19:17:00 -0000 From: Olivier Galibert To: Robert Dewar Cc: Dave Korn , 'Andrew Haley' , 'Gabriel Dos Reis' , 'Andrew Pinski' , 'gcc mailing list' Subject: Re: signed is undefined and has been since 1992 (in GCC) Message-ID: <20050628191746.GJ52889@dspnet.fr.eu.org> References: <20050628171752.GE52889@dspnet.fr.eu.org> <20050628180203.GG52889@dspnet.fr.eu.org> <42C19C5A.2040705@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42C19C5A.2040705@adacore.com> User-Agent: Mutt/1.4.2.1i X-SW-Source: 2005-06/txt/msg01184.txt.bz2 On Tue, Jun 28, 2005 at 02:52:10PM -0400, Robert Dewar wrote: > Olivier Galibert wrote: > >On Tue, Jun 28, 2005 at 06:36:26PM +0100, Dave Korn wrote: > > > >> It certainly wasn't meant to be. It was meant to be a dispassionate > >>description of the state of facts. Software that violates the C standard > >>just *is* "buggy" or "incorrect", and your personal pride has absolutely > >>nothing to do with it. > > > > > >Then your definition of "incorrect" is uninteresting. Per your > >definition, "use of implementation-defined behaviour is incorrect", > >essentially no non-trivial program is correct. Including gcc for a > >start, which can't be correct, ever. > > Nope, there is nothing in the C standard that suggests that a program > relying on implementation-defined behavior is incorrect of buggy, and that > has nothing to do with what Dave Korn wrote. There is a world of > difference between undefined and implementation-defined. Dave Korn wrote, in answer to a list of assumptions I wrote, that "There is a vast amount of bad software in the world, some blatantly buggy, some subtly-incorrect. To attempt to fix it all in the compiler rather than the source seems a bit bass-ackwards to me!" These assumptions were: - signed and unsigned types are modulo, except in loop induction variables where it's bad taste (to rely on the overflow doing anything specific) - sizeof(int) == 4, sizeof(long long) == 8 - sizeof(long) == sizeof(void *) == sizeof(void (*)()) Please tell me which of these assumptions are not implementation-defined but instead undefined. OG.