1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix PR 42501.

Make: *** Warning: File .. has modification time in the future

This is now a warning in the Task bar.
This commit is contained in:
Alain Magloire 2003-09-04 15:37:08 +00:00
parent 68beea8757
commit 4baaaf3c10

View file

@ -17,23 +17,26 @@ public class MakeErrorParser implements IErrorParser {
static int getDirectoryLevel(String line) { static int getDirectoryLevel(String line) {
int s = line.indexOf('['); int s = line.indexOf('[');
int num = 0;
if (s != -1) { if (s != -1) {
int e = line.indexOf(']'); int e = line.indexOf(']');
String number = line.substring(s + 1, e); String number = line.substring(s + 1, e).trim();
int num= Integer.parseInt(number); try {
return num; num = Integer.parseInt(number);
} catch (NumberFormatException exc) {
} }
return 0; }
return num;
} }
public boolean processLine(String line, ErrorParserManager eoParser) { public boolean processLine(String line, ErrorParserManager eoParser) {
// make\[[0-9]*\]: error_desc // make\[[0-9]*\]: error_desc
int firstColon= line.indexOf(':'); int firstColon= line.indexOf(':');
if (firstColon != -1 && line.startsWith("make")) { if (firstColon != -1 && line.startsWith("make")) { //$NON-NLS-1$
boolean enter = false; boolean enter = false;
String msg= line.substring(firstColon + 1); String msg= line.substring(firstColon + 1).trim();
if ((enter = msg.startsWith(" Entering directory")) || if ((enter = msg.startsWith("Entering directory")) || //$NON-NLS-1$
(msg.startsWith(" Leaving directory"))) { (msg.startsWith("Leaving directory"))) { //$NON-NLS-1$
int s = msg.indexOf('`'); int s = msg.indexOf('`');
int e = msg.indexOf('\''); int e = msg.indexOf('\'');
if (s != -1 && e != -1) { if (s != -1 && e != -1) {
@ -54,10 +57,19 @@ public class MakeErrorParser implements IErrorParser {
/* Could check to see if they match */ /* Could check to see if they match */
} }
} }
} else if (msg.startsWith(" ***")) { } else if (msg.startsWith("***")) { //$NON-NLS-1$
boolean warning = false;
if (msg.length() > 4) {
String s = msg.substring(3).trim();
warning = s.startsWith("Warning"); //$NON-NLS-1$
}
if (warning) {
eoParser.generateMarker(null, -1, msg, IMarkerGenerator.SEVERITY_WARNING, null);
} else {
eoParser.generateMarker(null, -1, msg, IMarkerGenerator.SEVERITY_ERROR_BUILD, null); eoParser.generateMarker(null, -1, msg, IMarkerGenerator.SEVERITY_ERROR_BUILD, null);
} }
} }
}
return false; return false;
} }
} }