diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/ErrorPattern.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/ErrorPattern.java index b3cc1e79255..8e00b38bcd3 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/ErrorPattern.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/ErrorPattern.java @@ -64,7 +64,15 @@ public class ErrorPattern { public ErrorPattern(String pattern, int groupDesc, int severity) { this(pattern, 0, 0, groupDesc, 0, severity); } - + + /** + * Pattern for errors that should be skipped. + * + * @param pattern + */ + public ErrorPattern(String pattern) { + this(pattern, 0, 0, 0, 0, -1); + } public Matcher getMatcher(CharSequence input) { return pattern.matcher(input); } @@ -104,12 +112,16 @@ public class ErrorPattern { } protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) { + int severity = getSeverity(matcher); + if (severity == -1) + // Skip + return true; + String fileName = getFileName(matcher); int lineNum = getLineNum(matcher); String desc = getDesc(matcher); String varName = getVarName(matcher); - int severity = getSeverity(matcher); - + IFile file = null; if (fileName != null) { file = eoParser.findFileName(fileName); 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 09d40e07220..d674c52fe2d 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 @@ -30,19 +30,12 @@ public class GCCErrorParser extends AbstractErrorParser { }; private static final ErrorPattern[] patterns = { - new ErrorPattern("\\(Each undeclared identifier is reported only once", 0, 0) { - protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) { - // Skip this one - return true; - } - }, - new ErrorPattern("for each function it appears in.\\)", 0, 0) { - protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) { - // Skip this one - return true; - } - }, - new ErrorPattern("((.:)?.*):([0-9]*)(:(0-9)*)?: ([Ww]arning: )?(.*)", 1, 3, 7, 0, 0) { + // The following are skipped + new ErrorPattern("\\(Each undeclared identifier is reported only once"), + new ErrorPattern("for each function it appears in.\\)"), + new ErrorPattern(": note:"), + // The following are not... + new ErrorPattern("((.:)?.*):([0-9]*)(:(0-9)*)?: (warning: )?(.*)", 1, 3, 7, 0, 0) { public String getVarName(Matcher matcher) { String desc = getDesc(matcher); Matcher varMatcher = null;