This is the mail archive of the java@gcc.gnu.org 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]
Other format: [Raw text]

Re: recent regression


Tom Tromey wrote:

Anybody care to claim this one?

fleche. gcj -C a.java
fleche. touch a.java
fleche. gcj -C a.java
a.java:0: warning: source file for class `a' is newer than its matching class file.  Source file `./a.java' used instead


We never used to emit that warning, which is bogus -- I specifically
asked to compile a.java, and in this situation reading a.class would
be wrong anyway.



I reopened an old PR on this issue:


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

The problem is that that load_class is being called on "a" while it is already being parsed. This is apparantly pretty harmless, except that the class resolution code called from load_class doesn't know about source files from the command line.

Here's a fix. OK to commit?

Regards

Bryce

2004-06-24  Bryce McKinlay  <mckinlay@redhat.com>

	PR java/1207.
	* parse.y (java_layout_seen_class_methods): Don't call load_class
	on class defined by source parser.

Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.484
diff -u -r1.484 parse.y
--- parse.y	24 Jun 2004 15:56:54 -0000	1.484
+++ parse.y	25 Jun 2004 01:52:19 -0000
@@ -7576,7 +7576,7 @@
         {
           tree cls = TREE_TYPE (TREE_VALUE (current));
 
-          if (! CLASS_LOADED_P (cls))
+          if (! CLASS_FROM_SOURCE_P (cls) && ! CLASS_LOADED_P (cls))
             load_class (cls, 0);
 
           layout_class_methods (cls);

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