Community
Participate
Working Groups
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
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-)
Created attachment 13376 [details] Proposed patch
Fix in head and branch. Thanks