Skip to content

Commit 27b8da4

Browse files
Classify unrecognized command line options as an error
Contributed by STMicroelectronics Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
1 parent 4d0eaac commit 27b8da4

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GCCErrorParserTests.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,13 @@ public void testGccErrorMessages_InConstexprExpansion() throws IOException {
232232
"unused parameter 'bitrate' [-Wunused-parameter]" },
233233
new String[] { GCC_ERROR_PARSER_ID });
234234
}
235+
236+
@Test
237+
public void testGccErrorMessages_UnrecognizedCommandLineOption() throws IOException {
238+
runParserTest(new String[] { "arm-none-eabi-gcc: error: unrecognized command-line option '--foobar'" }, 1, // errors
239+
0, //warnings
240+
0, //infos
241+
null, new String[] { "unrecognized command-line option '--foobar'" },
242+
new String[] { GCC_ERROR_PARSER_ID });
243+
}
235244
}

core/org.eclipse.cdt.core/plugin.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ CDTGNUCErrorParser.regex.ParseErrorBefore=(.*?):(\\d+):(\\d+:)? (parse error bef
6767
CDTGNUCErrorParser.regex.ErrorUndeclared=(.*?):(\\d+):(\\d+:)? [Ee]rror: ([`'"](.*)['"] undeclared .*)
6868
CDTGNUCErrorParser.regex.ErrorConflictingTypesFor=(.*?):(\\d+):(\\d+:)? [Ee]rror: (conflicting types for .*[`'"](.*)['"].*)
6969
CDTGNUCErrorParser.regex.GenericError=(.*?):(\\d+):(\\d+:)?\\s*(([Ee]rror)|(ERROR)): (.*)
70+
CDTGNUCErrorParser.regex.InvocationError=(.*?): (([Ee]rror)|(ERROR)): (.*)
7071
CDTGNUCErrorParser.regex.DefinedButNotUsed=(.*?):(\\d+):(\\d+:)? [Ww]arning: ([`'"](.*)['"] defined but not used.*)
7172
CDTGNUCErrorParser.regex.WarningConflictingTypesFor=(.*?):(\\d+):(\\d+:)? [Ww]arning: (conflicting types for .*[`'"](.*)['"].*)
7273
CDTGNUCErrorParser.regex.GenericWarning=(.*?):(\\d+):(\\d+:)?\\s*(([Ww]arning)|(WARNING)): (.*)

core/org.eclipse.cdt.core/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@
241241
regex="%CDTGNUCErrorParser.regex.GenericError"
242242
severity="Error"
243243
variable-expr="$3"/>
244+
<pattern description-expr="$5" eat-processed-line="true" file-expr="" line-expr="" regex="%CDTGNUCErrorParser.regex.InvocationError" severity="Error" variable-expr=""/>
244245
<pattern description-expr="$7" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="%CDTGNUCErrorParser.regex.GenericWarning" severity="Warning"/>
245246
<pattern description-expr="$10" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="%CDTGNUCErrorParser.regex.GenericInfo" severity="Info"/>
246247
<pattern description-expr="$4" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="%CDTGNUCErrorParser.regex.OtherError" severity="Error"/>

0 commit comments

Comments
 (0)