From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6081 invoked by alias); 5 Jan 2009 04:23:55 -0000 Received: (qmail 6073 invoked by uid 22791); 5 Jan 2009 04:23:55 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Jan 2009 04:23:50 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 4D6432A9649; Sun, 4 Jan 2009 23:23:47 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id rcQ94u-Z3B9q; Sun, 4 Jan 2009 23:23:47 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 844DD2A963A; Sun, 4 Jan 2009 23:23:46 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 94105E7ACD; Mon, 5 Jan 2009 08:23:36 +0400 (RET) Date: Mon, 05 Jan 2009 04:23:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFA: fix PR 9164 Message-ID: <20090105042336.GE31595@adacore.com> References: <20090104032948.GA3339@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i 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/msg00021.txt.bz2 > Tom> This fix defers the choice of type to the language, using the existing > Tom> language-arch machinery. I fixed the C language family, including > Tom> ObjC, but I left the other languages unchanged. I think the language > Tom> maintainers will have to make a change here, if one is needed or > Tom> desired. (FWIW I don't think Java needs a change, since I don't think > Tom> it is possible to invoke sizeof when Java is the selected language.) > > Daniel> Before adding all this, do you know of any language where the signed > Daniel> behavior is correct? > > Nope. I don't know that a signed type is incorrect, either. I really > know nothing about the other languages here, so I chose to preserve > the current behavior. In Ada, the equivalent of the sizeof operator is the 'Size attribute. This attribute is a function that returns the size in bits and its type is a ``universal_integer''. universal_integer is not a type you can use in declarations, but it allows any integer values, so I think that it would be reasonable to make the 'size attribute return a value of Integer type (thus signed). I checked the code, and we actually use builtin_type_int32 (we used to use builtin_type_int but this type is hard to get to, now, as you need access to the gdbarch). -- Joel