From bd43f8a328d3ca8d31ad241c79bd3bff0d5c4771 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Fri, 16 Jul 2004 18:40:14 +0000 Subject: [PATCH] Fix Pr 70252 * src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java --- core/org.eclipse.cdt.core/ChangeLog | 6 ++++ .../internal/errorparsers/GCCErrorParser.java | 33 +++++++++++++++---- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog index ee738ce759f..43af268060f 100644 --- a/core/org.eclipse.cdt.core/ChangeLog +++ b/core/org.eclipse.cdt.core/ChangeLog @@ -1,3 +1,9 @@ +2004-07-17 Brad Jarvinen. + + Fix Pr 70252 + + * src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java + 2004-07-16 Vladimir Hirsl 1. Implementation of HP-UX SOM binary parser. diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java index d7854bd448c..0a507250ee6 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java @@ -24,13 +24,17 @@ public class GCCErrorParser implements IErrorParser { // (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 @@ -98,10 +102,12 @@ public class GCCErrorParser implements IErrorParser { if (desc.startsWith ("(Each undeclared")) { //$NON-NLS-1$ // Do nothing. return false; - } else { + } + if (desc.endsWith(")")) { //$NON-NLS-1$ String previous = eoParser.getPreviousLine(); - if (desc.endsWith(")") //$NON-NLS-1$ - && previous.indexOf("(Each undeclared") >= 0 ) { //$NON-NLS-1$ + // It if is a "(Each undeclared ..." ignore this. + // we already have the error. + if (previous.indexOf("(Each undeclared") >= 0 ) { //$NON-NLS-1$ // Do nothing. return false; } @@ -149,6 +155,21 @@ public class GCCErrorParser implements IErrorParser { } } + /* + * 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, @@ -156,7 +177,7 @@ public class GCCErrorParser implements IErrorParser { * 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