From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4512 invoked by alias); 28 Jun 2005 16:42:05 -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 4058 invoked by uid 22791); 28 Jun 2005 16:41:39 -0000 Received: from us01smtp2.synopsys.com (HELO kiruna.synopsys.com) (198.182.44.80) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 28 Jun 2005 16:41:39 +0000 Received: from crone.synopsys.com (crone.synopsys.com [146.225.7.23]) by kiruna.synopsys.com (Postfix) with ESMTP id C8101F413; Tue, 28 Jun 2005 09:42:33 -0700 (PDT) Received: from piper.synopsys.com (localhost [127.0.0.1]) by crone.synopsys.com (8.9.1/8.9.1) with ESMTP id JAA14794; Tue, 28 Jun 2005 09:41:37 -0700 (PDT) Received: from piper.synopsys.com (localhost [127.0.0.1]) by piper.synopsys.com (8.12.10/8.12.3) with ESMTP id j5SGfbOe009619; Tue, 28 Jun 2005 09:41:37 -0700 Received: (from jbuck@localhost) by piper.synopsys.com (8.12.10/8.12.10/Submit) id j5SGfa7Z009617; Tue, 28 Jun 2005 09:41:36 -0700 Date: Tue, 28 Jun 2005 16:42:00 -0000 From: Joe Buck To: Dave Korn Cc: "'Olivier Galibert'" , "'Robert Dewar'" , "'Gabriel Dos Reis'" , "'Andrew Pinski'" , "'gcc mailing list'" Subject: Re: signed is undefined and has been since 1992 (in GCC) Message-ID: <20050628164136.GD9524@synopsys.com> References: <20050628142441.GA52889@dspnet.fr.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-SW-Source: 2005-06/txt/msg01140.txt.bz2 On Tue, Jun 28, 2005 at 03:39:38PM +0100, Dave Korn wrote: > ----Original Message---- > >From: Olivier Galibert > >Sent: 28 June 2005 15:25 > > > In particular, a very large number of C and C++ programs are written > > with the assumptions: > > This is a bad line of reasoning in general. 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! > > > - sizeof(int) == 4, sizeof(long long) == 8 > > > > - sizeof(long) == sizeof(void *) == sizeof(void (*)()) > > > > Break them and see your compiler rejected by pretty much everybody. > > And what about 64 bit architectures? Your assumptions are already widely > invalid and only going to get more so. No, all of Olivier's assumptions are valid on LP64 as well as ILP32 architectures. They are invalid on most DSP architectures, as well as on 16-bit embedded architectures, which I suppose you could call "widely invalid" if you count # of shipping parts. But they are a reasonable engineering tradeoff in many cases (it's a waste of time in most cases for a program that does a lot of bit manipulation to consider the case of 37 bit one's complement architectures with an 11 bit byte).