1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00

Bug 32025 (the second oldest CDT bug :) - the gcc error parser now skips over note: errors, such as candidates for overloaded methods.

This commit is contained in:
Doug Schaefer 2006-01-06 18:59:29 +00:00
parent 08b561e41d
commit 3843730ec0
2 changed files with 21 additions and 16 deletions

View file

@ -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);

View file

@ -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;