Bug 28234 - MAXHOSTNAMELEN usage in libjava
Summary: MAXHOSTNAMELEN usage in libjava
Status: RESOLVED DUPLICATE of bug 21821
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 4.1.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks: 21824
  Show dependency treegraph
 
Reported: 2006-07-03 12:08 UTC by Michael Banck
Modified: 2006-07-05 12:00 UTC (History)
5 users (show)

See Also:
Host: i686-pc-gnu0.3
Target: i686-pc-gnu0.3
Build: i686-pc-gnu0.3
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Banck 2006-07-03 12:08:46 UTC
libjava/java/net/natInetAddressPosix.cc is broken on system which have no limit for the hostname length (i.e., GNU):

/build/buildd/gcj-4.1-4.1.1/build/./gcc/xgcc -shared-libgcc -B/build/buildd/gcj-4.1-4.1.1/build/./gcc -nostdinc++ -L/build/buildd/gcj-4.1-4.1.1/build/i486-gnu/libstdc++-v3/src -L/build/buildd/gcj-4.1-4.1.1/build/i486-gnu/libstdc++-v3/src/.libs -B/usr/i486-gnu/bin/ -B/usr/i486-gnu/lib/ -isystem /usr/i486-gnu/include -isystem /usr/i486-gnu/sys-include -DHAVE_CONFIG_H -I. -I../../../src/libjava -I./include -I./gcj -I../../../src/libjava -Iinclude -I../../../src/libjava/include -I../../../src/libjava/classpath/include -I../../../src/libjava/classpath/native/fdlibm -I../../../src/libjava/../boehm-gc/include -I../boehm-gc/include -I../../../src/libjava/libltdl -I../../../src/libjava/libltdl -I../../../src/libjava/.././libjava/../gcc -I../../../src/libjava/../libffi/include -I../libffi/include -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -Wswitch-enum -D_FILE_OFFSET_BITS=64 -ffloat-store -fomit-frame-pointer -Wextra -Wall -D_GNU_SOURCE -DPREFIX=\"/usr\" -DLIBDIR=\"/usr/lib\" -DJAVA_HOME=\"/usr\" -DBOOT_CLASS_PATH=\"/usr/share/java/libgcj-4.1.2.jar\" -DJAVA_EXT_DIRS=\"/usr/share/java/ext\" -DGCJ_ENDORSED_DIRS=\"/usr/share/java/gcj-endorsed\" -DLIBGCJ_DEFAULT_DATABASE=\"/var/lib/gcj-4.1/classmap.db\" -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL=\"gcj-4.1/classmap.db\" -DTOOLEXECLIBDIR=\"/usr/lib\" -g -O2 -D_GNU_SOURCE -MT java/net/natInetAddress.lo -MD -MP -MF java/net/.deps/natInetAddress.Tpo -c java/net/natInetAddress.cc  -fPIC -DPIC -o java/net/.libs/natInetAddress.o
../../../src/libjava/java/lang/Class.h: In member function 'java::lang::Class* java::lang::Class::getComponentType()':
../../../src/libjava/java/lang/Class.h:354: warning: dereferencing type-punned pointer will break strict-aliasing rules
java/net/natInetAddress.cc: In static member function 'static java::lang::String* java::net::InetAddress::getLocalHostname()':
java/net/natInetAddress.cc:287: error: 'MAXHOSTNAMELEN' was not declared in this scope
java/net/natInetAddress.cc:288: error: 'buffer' was not declared in this scope
java/net/natInetAddress.cc:290: error: 'buffer' was not declared in this scope
make[6]: *** [java/net/natInetAddress.lo] Error 1
make[6]: Leaving directory `/build/buildd/gcj-4.1-4.1.1/build/i486-gnu/libjava'

Source is from gcj-4.1_4.1.1-6 from Debian unstable.
Comment 1 Andrew Pinski 2006-07-03 15:04:56 UTC
(In reply to comment #0)
> libjava/java/net/natInetAddressPosix.cc is broken on system which have no limit
> for the hostname length (i.e., GNU):
s/GNU/Hurd/.

Also this is a dup of bug 21821.

*** This bug has been marked as a duplicate of 21821 ***
Comment 2 Michael Banck 2006-07-03 15:37:33 UTC
> s/GNU/Hurd/.

Sure, I was merely following the GNU project's terminology here.

> Also this is a dup of bug 21821.

Maybe I am blind, but I don't see this particular issue mentioned in that bug, nor adressed by the patches attached to it.  I thought about following up to that PR, but as this bug is about MAXHOSTNAMELEN and #21821 is about MAXPATHLEN, I decided to open a new bug, sorry.

Can you elaborate?