1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

Move the code to check for "(Each undeclared" pattern.

Append the filename in the descripion if the resource is not found.
This commit is contained in:
Alain Magloire 2002-11-06 16:28:19 +00:00
parent aef723b19b
commit f9820ec147

View file

@ -60,9 +60,7 @@ public class GCCErrorParser implements IErrorParser {
return false; return false;
} }
} }
IFile file = eoParser.findFilePath(fileName);
if (file != null) {
// gnu c: filename:no: (Each undeclared identifier is reported // gnu c: filename:no: (Each undeclared identifier is reported
// only once. filename:no: for each function it appears in.) // only once. filename:no: for each function it appears in.)
if (desc.startsWith ("(Each undeclared")) { if (desc.startsWith ("(Each undeclared")) {
@ -76,6 +74,7 @@ public class GCCErrorParser implements IErrorParser {
return false; return false;
} }
} }
/* See if we can get a var name /* See if we can get a var name
* Look for: * Look for:
* 'foo' undeclared * 'foo' undeclared
@ -86,30 +85,33 @@ public class GCCErrorParser implements IErrorParser {
int s; int s;
if((s = desc.indexOf("\' undeclared")) != -1) { if((s = desc.indexOf("\' undeclared")) != -1) {
int p = desc.indexOf("`"); int p = desc.indexOf("`");
if(p != -1) { if (p != -1) {
varName = desc.substring(p+1, s); varName = desc.substring(p+1, s);
System.out.println("undex varName "+ varName); System.out.println("undex varName "+ varName);
} }
} else if((s = desc.indexOf("\' defined but not used")) != -1) { } else if((s = desc.indexOf("\' defined but not used")) != -1) {
int p = desc.indexOf("`"); int p = desc.indexOf("`");
if(p != -1) { if (p != -1) {
varName = desc.substring(p+1, s); varName = desc.substring(p+1, s);
System.out.println("unused varName "+ varName); System.out.println("unused varName "+ varName);
} }
} else if((s = desc.indexOf("conflicting types for `")) != -1) { } else if((s = desc.indexOf("conflicting types for `")) != -1) {
int p = desc.indexOf("\'", s); int p = desc.indexOf("\'", s);
if(p != -1) { if (p != -1) {
varName = desc.substring(desc.indexOf("`") + 1, p); varName = desc.substring(desc.indexOf("`") + 1, p);
System.out.println("confl varName "+ varName); System.out.println("confl varName "+ varName);
} }
} else if((s = desc.indexOf("previous declaration of `")) != -1) { } else if((s = desc.indexOf("previous declaration of `")) != -1) {
int p = desc.indexOf("\'", s); int p = desc.indexOf("\'", s);
if(p != -1) { if (p != -1) {
varName = desc.substring(desc.indexOf("`") + 1, p); varName = desc.substring(desc.indexOf("`") + 1, p);
System.out.println("prev varName "+ varName); System.out.println("prev varName "+ varName);
} }
} }
} else {
IFile file = eoParser.findFilePath(fileName);
if (file == null) {
// Parse the entire project. // Parse the entire project.
file = eoParser.findFileName(fileName); file = eoParser.findFileName(fileName);
if (file != null) { if (file != null) {
@ -119,14 +121,15 @@ public class GCCErrorParser implements IErrorParser {
file = null; file = null;
} }
} }
}
if (desc.startsWith("warning") || desc.startsWith("Warning")) {
severity = IMarkerGenerator.SEVERITY_WARNING;
}
// Display the fileName. // Display the fileName.
if (file == null) { if (file == null) {
desc = fileName + ": " + desc; desc = desc +"[" + fileName + "]";
}
}
if (desc.startsWith("warning") || desc.startsWith("Warning")) {
severity = IMarkerGenerator.SEVERITY_WARNING;
} }
eoParser.generateMarker(file, num, desc, severity, varName); eoParser.generateMarker(file, num, desc, severity, varName);
} }