Is this a bug?

Martin Kahlert martin.kahlert@infineon.com
Wed Sep 4 05:59:00 GMT 2002


Hi!
I got a strange result with gcj on linux here:

$ cat hello.java
public class hello
{
    final static long a = 1000000000;
    final static long b = 1000 * a;

    public static void main(String[] args)
    {
        System.out.println("a = " + a);
        System.out.println("b = " + b);
    }
}

$ gcj -o hello hello.java --main=hello
$ ./hello
a = 1000000000
b = -727379968

$ javac hello.java 
$ java hello
a = 1000000000
b = 1000000000000

$ gcj -v
Reading specs from /usr/local/snapshots/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/specs
Reading specs from /usr/local/snapshots/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/../../../libgcj.spec
rename spec lib to liborig
Configured with: ../gcc-20020902/configure --prefix=/usr/local/snapshots
--enable-languages=f77,c++,java --disable-threads --enable-shared=libstdc++
Thread model: single
gcc version 3.2.1 20020902 (prerelease)

Any idea?

Thanks in advance,
Martin.

-- 
The early bird catches the worm. If you want something else for       
breakfast, get up later.



More information about the Java mailing list