This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/12656] New: Inherited Static Methods Not Seen At Runtime


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12656

           Summary: Inherited Static Methods Not Seen At Runtime
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rmathew at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

Consider these classes:

------------------------------------ 8< ------------------------------------
public class Foo
{
  public static void main( String[] args)
  {
    System.out.println( "Hello World");
  }
}
------------------------------------ 8< ------------------------------------

------------------------------------ 8< ------------------------------------
public class Bar extends Foo
{
}
------------------------------------ 8< ------------------------------------

If you compile these using Sun's JDK 1.3/1.4, you can 
run "java Bar", which will cause Foo's main( ) to be
executed.

If you compile these using GCJ 3.4 CVS, at execution
you get:

    $ gij Bar
    no suitable method `main' in class

    $ gcj --main=Bar Foo.java Bar.java                                         
                                   

    $ ./a.out
    no suitable method `main' in class

>From a preliminary investigation, it looks
like "gnu/gcj/runtime/natFirstThread.cc" should
not call "_Jv_GetMethodLocal( )" and should
call something like (say) "Class.getMethod( )".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]