This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
A simple helloworld program compiles and runs correctly, but a test program involving inner classes fails on execution. My test classes and output are below.
Mark Wielaard did run this test sucessfully, using gcc version 2.97 20010117, which is same build I'm using. So presumably I'm doing something wrong.
I'm running Linux 2.2.14 (SuSE 6.4) on ix86 hardware. I removed all the old gcj 2.95 libraries and programs. My binutils are 2.10.91 (via CSV). Here's the procedure I followed to build gcc and gcj
- checked out a full copy of the gcc
- hacked the configure.in so that libgcj gets built.
- configured in a separate, empty directory (not in the CVS tree),
using
/usr/local/gcc_cvs/gcc/configure --prefix=/usr/local/gcc --enable-languages=c++,java- Deleted everything in /usr/local/gcc
I do still have a copy of gcc-2.95.2-19 on my system, but my $PATH=/usr/local/gcc/bin: ..., so I when I invoke gcj, the new version of the gcc should be invoked. (gcc -v -> Gcc Version 2.97 20010117). $LD_LIBRARY_PATH starts with /usr/local/gcc/lib (and I've checked all lib directories for stray libgcj libraries).
Has anyone else tried this under Linux?
Thanks,
Barnet
package A;
public class HasInnerClass {
InnerClass ic0;
public HasInnerClass() {
ic0 = new InnerClass();
System.err.println("In
HasInnerClass(), ic0.s = " + ic0.s);
}
public class InnerClass {
String s;
int i;
public InnerClass() {
s = "A stringggggggggggggggggggggggggggggggggggggggg";
i = 123;
}
}
public InnerClass newInnerClass() { return( new
InnerClass() ); }
}
package A;
public class UsesInnerClass {
public UsesInnerClass() {
HasInnerClass hic = new
HasInnerClass();
System.err.println(
"In UsesInnerClass(), hic.ic0.s = " + hic.ic0.s);
}
public static void main(String[] argv) { new
UsesInnerClass(); }
}
After compiling with gcj, gcc version 2.97 20010117 (experimental), running it yields
In HasInnerClass(), ic0.s = A stringggggggggggggggggggggggggggggggggggggggginstead of
Out of Memory! Returning NIL!
In HasInnerClass(), ic0.s = A stringgggggggggggggggggggggggggggggggggggggggIs this a known bug?
In UsesInnerClass(), hic.ic0.s = A stringggggggggggggggggggggggggggggggggggggggg
Regards,
Barnet Wagman
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |