United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6510126 intptr_t != int on all x86 operating systems
JDK-6510126 : intptr_t != int on all x86 operating systems

Details
Type:
Bug
Submit Date:
2007-01-05
Status:
Closed
Updated Date:
2012-10-08
Project Name:
JDK
Resolved Date:
2007-01-31
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs10 (b07)

Related Reports
Backport:
Backport:

Sub Tasks

Description
Received via the public mailing lists from ###@###.###:

I've been involved with porting the jdk to BSD for
several years now. One of the first things I need
to do is fix some improper datatypes only seen in
the x86 portion of hotspot where it assumes that
an intptr_t is the same datatype as an int. On at
least one BSD, intptr_t is defined as a long on x86,
which reveals the places in the x86 code where it
is assumed intptr_t is an int.

To see the problems I need to fix use the following
diff on linux/x86:

diff -ur hotspot.orig/src/share/vm/utilities/globalDefinitions_gcc.hpp hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
--- hotspot.orig/src/share/vm/utilities/globalDefinitions_gcc.hpp       2006-11-30 12:22:09.000000000 -0800
+++ hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp    2006-12-01 07:51:09.000000000 -0800
@@ -76,6 +76,8 @@
 # endif

 #ifdef LINUX
+typedef long intptr_t;
+#define __intptr_t_defined
 #include <inttypes.h>
 #include <signal.h>
 #include <ucontext.h>

Attached is a diff that corrects the improper datatype
assumptions. I don't have access to solaris/x86 or
windows/x86 so there could be additional changes needed
there.

Feeback, review and acceptance of this patch would be
much appreciated.

[patch omitted]

                                    

Comments
EVALUATION

Applied patch
                                     
2007-01-12



Hardware and Software, Engineered to Work Together