This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/12788] New: bad dependencies for inner classes
- From: "tneumann at pi3 dot informatik dot uni-mannheim dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Oct 2003 14:12:06 -0000
- Subject: [Bug java/12788] New: bad dependencies for inner classes
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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).