From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27415 invoked by alias); 19 Jul 2009 15:17:06 -0000 Received: (qmail 27398 invoked by uid 22791); 19 Jul 2009 15:17:03 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_72,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 19 Jul 2009 15:16:54 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6JFGoa5001451; Sun, 19 Jul 2009 11:16:50 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6JFGnFx030826; Sun, 19 Jul 2009 11:16:49 -0400 Received: from pearl.pink (vpn-12-92.rdu.redhat.com [10.11.12.92]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6JFGlkO026211; Sun, 19 Jul 2009 11:16:48 -0400 Message-ID: <4A6338DE.7040700@redhat.com> Date: Sun, 19 Jul 2009 15:17:00 -0000 From: Andrew Haley User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: Florian Weimer CC: Mathieu Malaterre , java@gcc.gnu.org Subject: Re: error: 'jvariant::jvariant(jbyte)' cannot be overloaded References: <87ab31nrc2.fsf@mid.deneb.enyo.de> <4A62D0B7.6010301@redhat.com> <87eisddr3y.fsf@mid.deneb.enyo.de> In-Reply-To: <87eisddr3y.fsf@mid.deneb.enyo.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2009-07/txt/msg00046.txt.bz2 On 07/19/2009 09:17 AM, Florian Weimer wrote: > * Andrew Haley: > >> On 07/19/2009 07:02 AM, Florian Weimer wrote: >>> * Mathieu Malaterre: >>> >>>> I am trying to compile VTK using gcj and I am getting those compiler >>>> error, could someone please let me know if the code is legal (should >>>> compile) or not: >>> This is legal per Sun's JNI specficiation: jboolean and jbyte are >>> distinct types because there signedness differs: >>> >>> >>> >>> It's a bug in GCC. >> I didn't see the original message to which this is replying. > > It's about C++ code which contains a function overloaded on jbyte and > jboolean. This fails with GCJ because they are typedef'ed to the same > type. > >> If you can make a test case I'll see if the bug can be fixed. > > Compare the table I referenced with these pieces from jni_md.h: > > | typedef int jbyte __attribute__((__mode__(__QI__))); > | typedef int jshort __attribute__((__mode__(__HI__))); > | typedef int jint __attribute__((__mode__(__SI__))); > | typedef int jlong __attribute__((__mode__(__DI__))); > | typedef int jboolean __attribute__((__mode__(__QI__))); > | typedef unsigned short jchar __attribute__((__mode__(__HI__))); > | typedef float jfloat; > | typedef double jdouble; > | typedef jint jsize; > > | typedef int8_t jbyte; > | typedef int16_t jshort; > | typedef int32_t jint; > | typedef int64_t jlong; > | typedef float jfloat; > | typedef double jdouble; > | typedef jint jsize; > | typedef int8_t jboolean; > | typedef uint16_t jchar; > > jboolean is signed, but Sun's spec says it should be unsigned. OK. I can fix it, but it's an ABI-incompatible change. There's no way this fix could be applied to any existing releases, only gcc 4.5. Andrew.