From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22478 invoked by alias); 20 Feb 2002 23:04:18 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22384 invoked from network); 20 Feb 2002 23:04:17 -0000 Received: from unknown (HELO bothner.com) (216.102.199.253) by sources.redhat.com with SMTP; 20 Feb 2002 23:04:17 -0000 Received: from bothner.com (eureka.bothner.com [192.168.1.9]) by bothner.com (8.11.6/8.11.6) with ESMTP id g1KN8fp02034; Wed, 20 Feb 2002 15:08:41 -0800 Message-ID: <3C742B97.2060609@bothner.com> Date: Wed, 20 Feb 2002 15:04:00 -0000 From: Per Bothner User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8+) Gecko/20020215 X-Accept-Language: en-us MIME-Version: 1.0 To: Daniel Jacobowitz CC: gdb-patches@sources.redhat.com Subject: Re: Fix PR gdb/265, 64-bit pointers in Java References: <20020211003818.A26546@nevyn.them.org> <20020220174154.A29999@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-02/txt/msg00570.txt.bz2 Daniel Jacobowitz wrote: > On Mon, Feb 11, 2002 at 12:38:18AM -0500, Daniel Jacobowitz wrote: > >>I don't know if Java allows the implicit 0x123456789 -> 0x123456789L >>conversion that we all know and love in C, It doesn't. From the Java Languages Specification 2nd ed 3.10.1: A compile-time error occurs if a decimal literal of type int is larger than 2147483648 (2^31), or if the literal 2147483648 appears anywhere other than as the operand of the unary - operator, or if a hexadecimal or octal int literal does not fit in 32 bits. > but it certainly behooves us to act that way on the command line. I don't see that. I think the current error is reasonable, but perhaps changing it to a warning would be better. However, silently changing the type may change which overloaded methods gets chosen, so it's a bad idea. > Per never answered me, Sorry. I guess I didn't notice the question to me. > I'm committing this as reasonably obvious, Please don't - it's wrong. >>+ if (type == java_int_type && n > (ULONGEST)0xffffffff) >>+ type = java_long_type; One might argue that if the radix is 10, perhaps it should be n > (ULONGEST)0x80000000 (given that Java doesn't have unsigned types). -- --Per Bothner per@bothner.com http://www.bothner.com/per/