From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29483 invoked by alias); 19 Jul 2009 15:23:36 -0000 Received: (qmail 29461 invoked by uid 22791); 19 Jul 2009 15:23:35 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,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:23:28 +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 n6JFNR7r002610; Sun, 19 Jul 2009 11:23:27 -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 n6JFNPMQ031539; Sun, 19 Jul 2009 11:23:26 -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 n6JFNNCV026726; Sun, 19 Jul 2009 11:23:24 -0400 Message-ID: <4A633A6A.8010306@redhat.com> Date: Sun, 19 Jul 2009 15:23: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: Dave Korn CC: Kai Tietz , Andrew Pinski , gcc@gcc.gnu.org, java@gcc.gnu.org Subject: Re: RFA: libjava seems to miss some files for win32 References: <90baa01f0907180506h1a58152du5d45d66628043ad9@mail.gmail.com> <4A61D6D6.7030707@gmail.com> <90baa01f0907180901o4dc45cedx795f9cf5650af5ca@mail.gmail.com> <4A6204A3.6040704@gmail.com> <90baa01f0907181027q47631936ib9fd57b733586ce4@mail.gmail.com> <4A621422.502@gmail.com> <4A621DC3.9080403@redhat.com> <90baa01f0907181222h541dd4ebv1b599c98dc7c1c9c@mail.gmail.com> <90baa01f0907190413j35ab1318qb81d4d3256747d0f@mail.gmail.com> <4A631FB6.1090908@gmail.com> In-Reply-To: <4A631FB6.1090908@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-07/txt/msg00368.txt.bz2 On 07/19/2009 02:29 PM, Dave Korn wrote: > Kai Tietz wrote: > >> There are a lot of issues about casting HANDLE values into jint types, >> which is for x86 valid, but for x64 can lead potential to pointer >> truncations. Those part need some review by libjava maintainers. My >> patch simply casts those kind of pointers via __UINTPTR_TYPE__ into >> integer scalar before casting it into jint. I put comments at those >> places, where some rework is necessary. > > Argh. You're replacing a bunch of warnings that draw attention to a real > problem by a bunch of silent fixmes in the code. That's a bit scary to me. Me too. That patch will not be accepted. >> Index: gcc/libjava/gnu/java/net/natPlainSocketImplWin32.cc >> =================================================================== >> --- gcc.orig/libjava/gnu/java/net/natPlainSocketImplWin32.cc 2009-07-19 12:06:54.200476000 +0200 >> +++ gcc/libjava/gnu/java/net/natPlainSocketImplWin32.cc 2009-07-19 12:13:45.727476500 +0200 >> @@ -58,7 +58,8 @@ >> >> // We use native_fd in place of fd here. From leaving fd null we avoid >> // the double close problem in FileDescriptor.finalize. >> - native_fd = (jint) hSocket; >> + // Fixme, it isn't correct to cast a HANDLE to integer scalar here for x64 >> + native_fd = (jint) (__UINTPTR_TYPE__) hSocket; >> } > > > Question is, can we change the sizes of the members of class objects, such > as gnu::java::net::PlainSocketImpl::native_fd, or do these objects and their > layout form part of an ABI, and/or do they ever get serialised? The Java guys > will be able to tell us. Yes, you can change them. Yes, they are part of an ABI. native_fd should be a jlong. Andrew.