Package-private access checking in GCJ 3.3

Ranjit Mathew rmathew@hotmail.com
Mon Jun 16 09:38:00 GMT 2003


Tom Tromey wrote:
> Ranjit> This change however exposes another problem - we do not use
> Ranjit> any bit to indicate package-private access and so 
> Ranjit> java_accstring_lookup( ) returns the closest available set
> Ranjit> flag, if any, and "" otherwise. This makes for some rather
> Ranjit> confusing error messages. :-)
>> Do you see a nice way to solve this? Could you post a sample program
> and message so we know the details? Maybe we could follow what some
> other compiler (jacks, JDK) does.

Since the caller of java_accstring_lookup( ) has more context
that it has, we can perhaps split this method into two (or more)
methods that return the string for a set of mutually
exclusive access modifiers.
A simpler solution could be for this method to return all
the set flags e.g. "package-private static" instead of the
first one it encounters. However, this would not provide
much insight to the hapless user.
> Ranjit> (BTW, we use the same bit for both ACC_SUPER and 
> Ranjit> ACC_SYNCHRONIZED and these are the only two that share a
> Ranjit> bit - is this by design or is this an oversight?)
>> Design. See java.lang.reflect.Modifier -- these values are specified
> by Java, not us.

*Except* for ACC_SUPER, everything else is there and has
the same value as defined by GCJ - what does ACC_SUPER mean?
Is it to specially flag references like "super.fooBar"?
> Ranjit> I have only "bubblestrapped" with this change and tested 
> Ranjit> against very simple testcases.
>> Make sure you rebuild libgcj from scratch. We may have library bugs
> that we don't know of due to this compiler bug.

Yes, I realise that. I will try it tonight and let you
know if I face any problems.
Ranjit.
-- 
Ranjit Mathew Email: rmathew AT hotmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /