United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6679422 networkStream::connect() in ostream.cpp is not 64-bit clean
6679422 : networkStream::connect() in ostream.cpp is not 64-bit clean

Details
Type:
Bug
Submit Date:
2008-03-25
Status:
Closed
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2010-01-13
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs10
Fixed Versions:
hs12

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

Description
Building a 64-bit VM on linux with "gcc (GCC) 3.4.3 20050227 (Red Hat 3.4.3-22.1)" dies with:

src/share/vm/utilities/ostream.cpp: In member function `bool networkStream::connect(const char*, short int)':
src/share/vm/utilities/ostream.cpp:832: warning: comparison is always false due to limited range of data type
gmake[2]: *** [ostream.o] Error 1

                                    

Comments
SUGGESTED FIX

Use uint32_t instead of unsigned long.  Would like to use in_addr_t, which is available on linux and solaris, but only on *some* windows versions, not all.  Sigh.
                                     
2008-03-25
EVALUATION

Line 832 is:

   if (server.sin_addr.s_addr == (unsigned long) -1) 

sin_addr.s_addr is a 32-bit inteter; unsigned long is a 64-bit integer in a 64-bit build.

*** (#1 of 1): [ UNSAVED ] ###@###.###
                                     
2008-03-25



Hardware and Software, Engineered to Work Together