Bug 70252 - GCCErrorParser unrecognized pattern
Summary: GCCErrorParser unrecognized pattern
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Alain Magloire CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2004-07-16 14:01 EDT by PalmSource Eclipse Bug Tracker CLA
Modified: 2008-06-18 18:40 EDT (History)
0 users

See Also:


Attachments
Proposed patch (1.76 KB, patch)
2004-07-16 14:30 EDT, PalmSource Eclipse Bug Tracker CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description PalmSource Eclipse Bug Tracker CLA 2004-07-16 14:01:50 EDT
I found an error in the GCCErrorParser in which it was not recognizing a 
pattern:

// In file included from hello.c:3:
// c.h:2:15: missing ')' in macro parameter list

GCCErrorParser already recognized a similar but slightly different pattern:

// In file included from b.h:2,
//				 from a.h:3,
//				 from hello.c:3:
// c.h:2:15: missing ')' in macro parameter list

The patch (which you may use if desired) was an easy fix to add an extra if 
statement to do a check for "In file included from", similar to the already 
recognized similar pattern.  This problem is present both in CDT 1.2.1 and CDT 
2.0; the patch is for CDT 2.0.

--- src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java	2004-
07-06 17:02:32.939385800 -0700
+++ src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java	2004-
07-06 16:48:25.663950200 -0700
@@ -24,13 +24,17 @@
 		// (b)
 		// filename:lineno:column: description
 		//
-		// (b)
+		// (c)
 		// In file included from b.h:2,
 		//				 from a.h:3,
 		//				 from hello.c:3:
 		// c.h:2:15: missing ')' in macro parameter list
 		//
-		// (c)
+		// (d)
+		// In file included from hello.c:3:
+		// c.h:2:15: missing ')' in macro parameter list
+		//
+		// (e)
 		// h.c: In function `main':
 		// h.c:41: `foo' undeclared (first use in this function)
 		// h.c:41: (Each undeclared identifier is reported only once
@@ -150,13 +154,28 @@
 					 }
 
 					/*
+					 *	In file included from 
hello.c:3:
+					 *	 c.h:2:15: missing ')' in 
macro parameter list
+					 *
+					 * We reconstruct the multiline gcc 
errors to multiple errors:
+					 *    c.h:2:15: missing ')' in macro 
parameter list
+					 *    hello.c:3:  in inclusion c.h:2:15
+					 *     
+					 */
+					if (line.startsWith("In file included 
from ")) { //$NON-NLS-1$
+						// We want the last error in 
the chain, so continue.
+						eoParser.appendToScratchBuffer
(line);
+						return false;
+					}
+
+					/*
 					 *	In file included from b.h:2,
 					 *				
	 from a.h:3,
 					 *				
	 from hello.c:3:
 					 *	 c.h:2:15: missing ')' in 
macro parameter list
 					 *
 					 * We reconstruct the multiline gcc 
errors to multiple errors:
-					 *    c.h:3:15: missing ')' in macro 
parameter list
+					 *    c.h:2:15: missing ')' in macro 
parameter list
 					 *    b.h:2:  in inclusion c.h:3:15
 					 *    a.h:3:  in inclusion b.h:2
 					 *    hello.c:3:  in inclusion a.h:3
Comment 1 Alain Magloire CLA 2004-07-16 14:26:47 EDT
Brad,

  Could you attach the patch instead, cut and paste is playing havoc
with the patch

> The patch (which you may use if desired) was an easy fix to add an extra if 
> statement to do a check for "In file included from", similar to the already 
> recognized similar pattern.

I see no reason not to put it in head and branch ... if I can get
a valid patch i.e generate a patch frm eclipse that will make things
much simpler on this side of things 8-)
Comment 2 PalmSource Eclipse Bug Tracker CLA 2004-07-16 14:30:55 EDT
Created attachment 13376 [details]
Proposed patch
Comment 3 Alain Magloire CLA 2004-07-16 14:50:59 EDT
Fix in head and branch.

Thanks