lex.c oddity

Tom Tromey tromey@redhat.com
Tue Nov 18 15:34:00 GMT 2003


>>>>> "Jeff" == Jeff Sturm <jsturm@one-point.com> writes:

Jeff> While debugging the parser, I stumbled across this code in java_init_lex:
Jeff>   int java_lang_imported = 0;
Jeff>   ...
Jeff>   if (!java_lang_imported)
Jeff>     {
Jeff>       ...
Jeff>       java_lang_imported = 1;
Jeff> Clearly the conditional is always taken.  Was this meant to be declared
Jeff> static?  (I tried; it doesn't work.)

Sure looks that way, doesn't it?
Hmm, that line predates the import into the public gcc tree.
At this point, probably no-one knows what was intended here.

What happens when you change this to static?
Perhaps we're supposed to read java.lang for each file.  That makes
sense in a way... but then, I've never really read through the import
handling code.

Tom



More information about the Java mailing list