1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-05 07:15:39 +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) { public ErrorPattern(String pattern, int groupDesc, int severity) {
this(pattern, 0, 0, groupDesc, 0, 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) { public Matcher getMatcher(CharSequence input) {
return pattern.matcher(input); return pattern.matcher(input);
} }
@ -104,12 +112,16 @@ public class ErrorPattern {
} }
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) { protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
int severity = getSeverity(matcher);
if (severity == -1)
// Skip
return true;
String fileName = getFileName(matcher); String fileName = getFileName(matcher);
int lineNum = getLineNum(matcher); int lineNum = getLineNum(matcher);
String desc = getDesc(matcher); String desc = getDesc(matcher);
String varName = getVarName(matcher); String varName = getVarName(matcher);
int severity = getSeverity(matcher);
IFile file = null; IFile file = null;
if (fileName != null) { if (fileName != null) {
file = eoParser.findFileName(fileName); file = eoParser.findFileName(fileName);

View file

@ -30,19 +30,12 @@ public class GCCErrorParser extends AbstractErrorParser {
}; };
private static final ErrorPattern[] patterns = { private static final ErrorPattern[] patterns = {
new ErrorPattern("\\(Each undeclared identifier is reported only once", 0, 0) { // The following are skipped
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) { new ErrorPattern("\\(Each undeclared identifier is reported only once"),
// Skip this one new ErrorPattern("for each function it appears in.\\)"),
return true; new ErrorPattern(": note:"),
} // The following are not...
}, new ErrorPattern("((.:)?.*):([0-9]*)(:(0-9)*)?: (warning: )?(.*)", 1, 3, 7, 0, 0) {
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) {
public String getVarName(Matcher matcher) { public String getVarName(Matcher matcher) {
String desc = getDesc(matcher); String desc = getDesc(matcher);
Matcher varMatcher = null; Matcher varMatcher = null;