Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] LD Error parser patch PR 48717

Folks,

  This patch addresses the issue presented in PR 48717 
where the ld error parser always assumes that the condition
is "an error" rather than scanning to see if the notification
is just a warning.  This patch adds the capability to use
a warning marker instead of a problem marker in these cases.

ChangeLog
 Update to classify ld warnings as warning markers instead
of "problem" markers.

Thanks,
 Thomas

Index: src/org/eclipse/cdt/internal/errorparsers/GLDErrorParser.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GLDErrorParser.java,v
retrieving revision 1.3
diff -u -r1.3 GLDErrorParser.java
--- src/org/eclipse/cdt/internal/errorparsers/GLDErrorParser.java	23 Oct 2002 18:22:10 -0000	1.3
+++ src/org/eclipse/cdt/internal/errorparsers/GLDErrorParser.java	15 Dec 2003 02:31:53 -0000
@@ -20,6 +20,8 @@
 		// 2-
 		// Something went wrong check if it is "ld" the linkeer bay cheching
 		// the last letter for "ld"
+		// An example might be (not all are warnings):
+		// ntox86-ld: warning: libcpp.so.2, needed by C:/temp//libdisplay.so, may conflict with libcpp.so.3
 		int firstColon= line.indexOf(':');
 		if (firstColon != -1) {
 			String buf= line.substring(0, firstColon);
@@ -46,12 +48,21 @@
 				} 
 				eoParser.generateMarker(file, 0, desc, IMarkerGenerator.SEVERITY_ERROR_RESOURCE, null);
 			} else if (buf.endsWith("ld")){
+				//By default treat the condition as fatal/error, unless marked as a warning
+				int errorType = IMarkerGenerator.SEVERITY_ERROR_RESOURCE;
+				if(desc.trim().startsWith("warning:")) {
+					errorType = IMarkerGenerator.SEVERITY_WARNING;
+				}
+
+				//@@@ Is this is the same as buf, which we know to be ld.
+				//It is unlikely that we will ever get a real value for this
 				String fileName = line.substring(0, firstColon);
 				IFile file = eoParser.findFilePath(fileName);
 				if (file == null) {
 					desc = fileName + " " + desc;
 				} 
-				eoParser.generateMarker(file, 0, desc, IMarkerGenerator.SEVERITY_ERROR_RESOURCE, null);
+				
+				eoParser.generateMarker(file, 0, desc, errorType, null);
 			}
 		}
 		return false;

Back to the top