Bug 125961

Summary: Add "emacs style" output to batch compiler
Product: [Eclipse Project] JDT Reporter: Tom Tromey <tromey>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M5   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch to add -Xemacs flag none

Description Tom Tromey CLA 2006-01-31 19:56:41 EST
I'm investigating using the eclipse jdt compiler as the .java front
end for gcc -- i.e., replacing the java-parsing parts of gcj.
One issue that come up while looking into this is the formatting of
the batch compiler's error messages.  gcc requires messages to follow
the GNU coding standards:

http://www.gnu.org/prep/standards/html_node/Errors.html#Errors

(Note that gcj extends this to show the actual source line as well,
similar to how eclipse's batch compiler does.)

I've written a patch to add this output style.  It is enabled by passing
the '-Xemacs' flag to the batch compiler.  Without this flag, output
remains as it is today.

I'll attach the patch shortly.
Comment 1 Tom Tromey CLA 2006-01-31 19:57:09 EST
Created attachment 33911 [details]
patch to add -Xemacs flag
Comment 2 Tom Tromey CLA 2006-01-31 19:58:26 EST
Oops... I just realized that I forgot to remove the .settings change
I made for bug #125953 -- it is still in the patch.  Sorry about that.
Comment 3 Olivier Thomann CLA 2006-01-31 23:50:37 EST
Fixed and released in HEAD.
Tom, I made minor changes to facilitate the addition of other kind of logging.
I replaced the existing boolean with a tagBits field and constants.
Let me know if the released version works as expected.
From my testing I would say yes.
Comment 4 Olivier Thomann CLA 2006-01-31 23:51:22 EST
Your contribution has been included under the EPL term. Let me know if this is fine.
Comment 5 Tom Tromey CLA 2006-02-01 13:54:38 EST
The EPL is fine.
Thanks for checking this in!
I tried it out here and it works great.
Comment 6 Tom Tromey CLA 2006-02-04 14:19:07 EST
I'm reopening this because the output is not quite right.
I ran it again today and noticed this, sorry for not noticing earlier.
I get this output:

t.java:4: warning: The local variable y is never read
 (at line 4)
        int y;
            ^

But I think the text "(at line 4)" is redundant.
I haven't looked at patching this yet.
Comment 7 Olivier Thomann CLA 2006-02-05 12:38:45 EST
I'll fix it.
Comment 8 Olivier Thomann CLA 2006-02-05 20:59:56 EST
Fixed and released in HEAD.
Comment 9 Olivier Thomann CLA 2006-02-05 21:02:19 EST
Fixed.
Comment 10 Tom Tromey CLA 2006-02-06 14:53:07 EST
Looks great, thanks!
Comment 11 David Audel CLA 2006-02-15 10:15:25 EST
Verified for 3.2 M5 using build I20060215-0010