Skip to main content
summaryrefslogtreecommitdiffstats
path: root/xlc
diff options
context:
space:
mode:
authorAndrew Gvozdev2010-11-23 12:09:20 -0500
committerAndrew Gvozdev2010-11-23 12:09:20 -0500
commitd731ae4f20f64486b983e3618b69d33a62e2db35 (patch)
treeb58eef614c2a02b6780788f7d9a50fbce6268495 /xlc
parentd0b4e55624680e69c61d0fe5433b8ff5ec751cd9 (diff)
downloadorg.eclipse.cdt-d731ae4f20f64486b983e3618b69d33a62e2db35.tar.gz
org.eclipse.cdt-d731ae4f20f64486b983e3618b69d33a62e2db35.tar.xz
org.eclipse.cdt-d731ae4f20f64486b983e3618b69d33a62e2db35.zip
bug 330941: Xlc error parser can't figure out that file name is in quotes
Diffstat (limited to 'xlc')
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java2
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMacroRedefinition.java21
-rw-r--r--xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties16
3 files changed, 26 insertions, 13 deletions
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java
index df4a98f677..f8973e86fb 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java
@@ -32,7 +32,7 @@ public class AllXlcErrorParserTests {
suite.addTestSuite(TestNoFuncProto.class);
suite.addTestSuite(TestCompatibility.class);
suite.addTestSuite(TestUnrecoverableError.class);
- suite.addTestSuite(TestMacroRedefinition.class);
+ suite.addTestSuite(TestRedefinition.class);
suite.addTestSuite(TestRedeclaration.class);
suite.addTestSuite(TestLinkerUndefinedSymbol.class);
suite.addTestSuite(TestLinkerDuplicateSymbol.class);
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMacroRedefinition.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMacroRedefinition.java
index c890612a91..82b20113bc 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMacroRedefinition.java
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestMacroRedefinition.java
@@ -18,7 +18,7 @@ public class TestMacroRedefinition extends TestCase {
/**
* This function tests parseLine function of the
* XlcErrorParser class. The second message generated by
- * xlc compiler for macro redefinition problem is given as
+ * xlc compiler for macro/variable redefinition problem is given as
* input for testing.
*/
public void testparseLine()
@@ -28,19 +28,32 @@ public class TestMacroRedefinition extends TestCase {
// Second line is re-parsed to 2 warnings to cross-reference both.
String err_msg1 = "\"temp1.c\", line 5.9: 1506-236 (W) Macro name TEMP_1 has been redefined.";
String err_msg2 = "\"temp1.c\", line 5.9: 1506-358 (I) \"TEMP_1\" is defined on line 3 of temp1.h.";
+ // variation of the message
+ String err_msg3 = "\"temp2.c\", line 17.9: 1506-358 (I) \"MACRO_2\" is defined on line 10 of \"temp2.c\".";
aix.parseLine(err_msg1);
aix.parseLine(err_msg2);
- assertEquals(2, aix.getNumberOfMarkers());
+ aix.parseLine(err_msg3);
+ assertEquals(4, aix.getNumberOfMarkers());
- assertEquals("Macro name TEMP_1 has been redefined on line 5 of temp1.c", aix.getMessage(0));
+ assertEquals("\"TEMP_1\" has been redefined on line 5 of temp1.c", aix.getMessage(0));
assertEquals("temp1.h", aix.getFileName(0));
assertEquals(3, aix.getLineNumber(0));
assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(0));
- assertEquals("Macro name TEMP_1 redefines macro originally defined on line 3 of temp1.h", aix.getMessage(1));
+ assertEquals("\"TEMP_1\" redefines original definition on line 3 of temp1.h", aix.getMessage(1));
assertEquals("temp1.c", aix.getFileName(1));
assertEquals(5, aix.getLineNumber(1));
assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(1));
+
+ assertEquals("\"MACRO_2\" has been redefined on line 17 of temp2.c", aix.getMessage(2));
+ assertEquals("temp2.c", aix.getFileName(2));
+ assertEquals(10, aix.getLineNumber(2));
+ assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(2));
+
+ assertEquals("\"MACRO_2\" redefines original definition on line 10 of temp2.c", aix.getMessage(3));
+ assertEquals("temp2.c", aix.getFileName(3));
+ assertEquals(17, aix.getLineNumber(3));
+ assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(3));
}
public TestMacroRedefinition( String name)
{
diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties b/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties
index f2a22c4eb1..405a9e7419 100644
--- a/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties
+++ b/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties
@@ -24,17 +24,17 @@ CDTXLCErrorParser.name=CDT xlC Error Parser
# START NON-TRANSLATABLE
# "hello.c", line 5.9: 1506-358 (I) "MACRO" is defined on line 3 of hello.h.
-CDTXLCErrorParser.pattern.macro=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(I\\)\\s*["]?(\\w*)["]? is defined on line ([0-9]+) of (.*)\\.
-CDTXLCErrorParser.pattern.macro.replacement=Macro name $4 has been redefined on line $2 of $1
-CDTXLCErrorParser.pattern.macro.crossreference=Macro name $4 redefines macro originally defined on line $5 of $6
-CDTXLCErrorParser.pattern.macro.ignore=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(W\\)\\s*Macro name .* has been redefined\\.
+CDTXLCErrorParser.pattern.macro="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(I\\)\\s*(.*) is defined on line ([0-9]+) of "?([^"]*)"?\\.
+CDTXLCErrorParser.pattern.macro.replacement=$4 has been redefined on line $2 of $1
+CDTXLCErrorParser.pattern.macro.crossreference=$4 redefines original definition on line $5 of $6
+CDTXLCErrorParser.pattern.macro.ignore="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(W\\)\\s*Macro name .* has been redefined\\.
# "src/temp1.c", line 6.6: 1506-343 (S) Redeclaration of fun differs from previous declaration on line 334 of "include/temp1.h".
-CDTXLCErrorParser.pattern.redeclaration=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(S\\)\\s*Redeclaration of (\\w+) differs from previous declaration on line (\\d+) of "(.*)"\\.
+CDTXLCErrorParser.pattern.redeclaration="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(S\\)\\s*Redeclaration of (\\w+) differs from previous declaration on line (\\d+) of "?([^"]*)"?\\.
CDTXLCErrorParser.pattern.redeclaration.crossreference=Redeclaration of $4 differs from another declaration on line $2 of "$1".
# "main.cpp", line 10.6: 1540-0064 (S) Syntax error: "name" was expected but "char" was found.
-CDTXLCErrorParser.pattern.error=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\([USE]\\)\\s*(.*)
-CDTXLCErrorParser.pattern.warning=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(W\\)\\s*(.*)
-CDTXLCErrorParser.pattern.info=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(I\\)\\s*(.*)
+CDTXLCErrorParser.pattern.error="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\([USE]\\)\\s*(.*)
+CDTXLCErrorParser.pattern.warning="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(W\\)\\s*(.*)
+CDTXLCErrorParser.pattern.info="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(I\\)\\s*(.*)
# ld: 0711-224 WARNING: Duplicate symbol: symboldupe
# WARNING, ERROR, SEVERE ERROR etc.
CDTXLCErrorParser.pattern.ld.error=ld: ([0-9]+-[0-9]+).*ERROR:\\s*(.*)

Back to the top