From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17284 invoked by alias); 28 Jun 2005 14:52:08 -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 17192 invoked by uid 22791); 28 Jun 2005 14:52:01 -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 14:52:01 +0000 Received: by dspnet.fr.eu.org (Postfix, from userid 1007) id BC6E334D22; Tue, 28 Jun 2005 16:51:48 +0200 (CEST) Date: Tue, 28 Jun 2005 14:52:00 -0000 From: Olivier Galibert To: Dave Korn Cc: 'Robert Dewar' , 'Gabriel Dos Reis' , 'Andrew Pinski' , 'gcc mailing list' Subject: Re: signed is undefined and has been since 1992 (in GCC) Message-ID: <20050628145148.GD52889@dspnet.fr.eu.org> 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.2.1i X-SW-Source: 2005-06/txt/msg01125.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! Welcome to the real world. Useful compilers are not an exercise in theorical computing, especially for languages like C or C++. > > - 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. They aren't. They have: - sizeof(int) == 4, sizeof(long long) == 8 - sizeof(long) == sizeof(void *) == sizeof(void (*)()) == 8 and nobody in his right mind would seriously propose to change sizeof(int) to 8 or sizeof(long long) to 16. IA-64 may have an issue with sizeof(void (*)()) from what I've heard, but they have been laughed out of the market. OG.