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 java/12788] New: bad dependencies for inner classes


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

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

           Summary: bad dependencies for inner classes
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tneumann at pi3 dot informatik dot uni-mannheim dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i386-mingw32msvc

When using gcj to produce dependencies (-MMD) for Java code with inner classes, 
it adds the source file _and_ the .class file of the inner class. While this is 
technically correct, it should not be done as it creates cyclic dependencies.

E.g. given the two files
A.java: class A { public interface AA {} B.BB b; }
B.java: class B { public interface BB { } A.AA a; }

compiling these files with (has to be compiled twice):
gcj -MMD -C A.java
gcj -MMD -C B.java
gcj -MMD -C A.java
gcj -MMD -C B.java

results in the dependencies
./A$$AA.class ./A.class: A.java ./B.java ./B$$BB.class
./B$$BB.class ./B.class: B.java ./A.java ./A$$AA.class

This creates a cyclic dependency, which makes the dependencies more or less 
worthless. The nicer behaviour would be to ommit the .class files in the 
dependency lists, as they are already implied by their .java files (of course 
this is only possible if the .java files are actually available).


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