From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12313 invoked by alias); 4 Jan 2009 03:29:58 -0000 Received: (qmail 12304 invoked by uid 22791); 4 Jan 2009 03:29:57 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 04 Jan 2009 03:29:53 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id AF54010995; Sun, 4 Jan 2009 03:29:49 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 7CA5610630; Sun, 4 Jan 2009 03:29:49 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1LJJgS-0000sB-M7; Sat, 03 Jan 2009 22:29:48 -0500 Date: Sun, 04 Jan 2009 03:29:00 -0000 From: Daniel Jacobowitz To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFA: fix PR 9164 Message-ID: <20090104032948.GA3339@caradoc.them.org> Mail-Followup-To: Tom Tromey , gdb-patches@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-01/txt/msg00017.txt.bz2 On Sat, Jan 03, 2009 at 02:19:53PM -0700, Tom Tromey wrote: > This patch fixes PR 9164. > > The bug is that the result of sizeof has signed type, not unsigned. > The C and C++ standards require an unsigned type here. > > This fix defers the choice of type to the language, using the existing > language-arch machinery. I fixed the C language family, including > ObjC, but I left the other languages unchanged. I think the language > maintainers will have to make a change here, if one is needed or > desired. (FWIW I don't think Java needs a change, since I don't think > it is possible to invoke sizeof when Java is the selected language.) > > Built and regtested on x86-64 (compile farm). > New test case included. Before adding all this, do you know of any language where the signed behavior is correct? -- Daniel Jacobowitz CodeSourcery