Quoting In Error/Warning Messages for Java

Ranjit Mathew rmathew@gmail.com
Sun Sep 19 03:25:00 GMT 2004


On 2004年9月18日 09:01:53 -0700, Per Bothner <per@bothner.com> wrote:
> Ranjit Mathew wrote:
>> > I found that most of the errors were being issued via
> > parse_error_context( ) which (like parse_warning_context) uses
> > issue_warning_error_from_context( ) (all defined in parse.y)
> > which directly uses vsprintf() to create the message.
>> The reason for that is probably to be able to emit "caret" diagnostics:
> error messages including column numbers and echoing the
> erroneous line. Hopefully soon the USE_MAPPED_LOCATION patch
> will be in, which will remove/reduce the need for the special
> error handling.

Ok.
> > For the rest, shall I just use 'foo' style quoting instead of
> > `foo'?
>> How about for now using %<...%> and writing a 5-line patch to
> convert %<...%> to '...'. Then we can use the new %<...%>
> immediately.

That's what I tried next. However, parse_error_context()
is marked ATTRIBUTE_PRINTF in java-tree.h and the 
bootstrapping compiler warns (and therefore errors 
out due to -Werror) about unknown format specifiers 
'%<' and '%>'. So I had to mark them 
ATTRIBUTE_GCC_FE_DIAG(2,3) which is defined in
"toplev.h" - this leads to the requirement that 
"toplev.h" be included before "java-tree.h" everywhere.
So I had to touch almost every source file to correct
this...
...including gjavah, which defines its own "error()"
function which clashes with that in "toplev.h" and
so I had to correct that...
Alternatively, I can just define the appropriate
attribute in-situ in "java-tree.h", but that will not be
clean enough...
In short, IMHO, it becomes too intrusive at this
stage.
My options:
1. Wait for your "--enable-mapped-location" patch
which probably can be made default (and the only
thingy) for GCJ.
2. Just use 'foo' style blindly everywhere...
What do you suggest?
BTW, if your "--enable-mapped-location" patch
gets in, will we get rid of all WFLs and EWFLs?
That would be cool because I could never grok
them completely.
Thanks,
Ranjit.
-- 
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/


More information about the Java mailing list

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