Skip to content

Commit

Permalink
Classify unrecognized command line options as an error
Browse files Browse the repository at this point in the history
Contributed by STMicroelectronics

Signed-off-by: Torbjörn Svensson <[email protected]>
  • Loading branch information
Torbjorn-Svensson committed Oct 12, 2024
1 parent 4d0eaac commit 054deab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,13 @@ public void testGccErrorMessages_InConstexprExpansion() throws IOException {
"unused parameter 'bitrate' [-Wunused-parameter]" },
new String[] { GCC_ERROR_PARSER_ID });
}

@Test
public void testGccErrorMessages_UnrecognizedCommandLineOption() throws IOException {
runParserTest(new String[] { "arm-none-eabi-gcc: error: unrecognized command-line option '--foobar'" }, 1, // errors
0, //warnings
0, //infos
null, new String[] { "unrecognized command-line option '--foobar'" },
new String[] { GCC_ERROR_PARSER_ID });
}
}
1 change: 1 addition & 0 deletions core/org.eclipse.cdt.core/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ CDTGNUCErrorParser.regex.ParseErrorBefore=(.*?):(\\d+):(\\d+:)? (parse error bef
CDTGNUCErrorParser.regex.ErrorUndeclared=(.*?):(\\d+):(\\d+:)? [Ee]rror: ([`'"](.*)['"] undeclared .*)
CDTGNUCErrorParser.regex.ErrorConflictingTypesFor=(.*?):(\\d+):(\\d+:)? [Ee]rror: (conflicting types for .*[`'"](.*)['"].*)
CDTGNUCErrorParser.regex.GenericError=(.*?):(\\d+):(\\d+:)?\\s*(([Ee]rror)|(ERROR)): (.*)
CDTGNUCErrorParser.regex.GenericError2=(.*?): (([Ee]rror)|(ERROR)): (.*)
CDTGNUCErrorParser.regex.DefinedButNotUsed=(.*?):(\\d+):(\\d+:)? [Ww]arning: ([`'"](.*)['"] defined but not used.*)
CDTGNUCErrorParser.regex.WarningConflictingTypesFor=(.*?):(\\d+):(\\d+:)? [Ww]arning: (conflicting types for .*[`'"](.*)['"].*)
CDTGNUCErrorParser.regex.GenericWarning=(.*?):(\\d+):(\\d+:)?\\s*(([Ww]arning)|(WARNING)): (.*)
Expand Down
1 change: 1 addition & 0 deletions core/org.eclipse.cdt.core/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
regex="%CDTGNUCErrorParser.regex.GenericError"
severity="Error"
variable-expr="$3"/>
<pattern description-expr="$5" eat-processed-line="true" file-expr="" line-expr="" regex="%CDTGNUCErrorParser.regex.GenericError2" severity="Error" variable-expr=""/>
<pattern description-expr="$7" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="%CDTGNUCErrorParser.regex.GenericWarning" severity="Warning"/>
<pattern description-expr="$10" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="%CDTGNUCErrorParser.regex.GenericInfo" severity="Info"/>
<pattern description-expr="$4" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="%CDTGNUCErrorParser.regex.OtherError" severity="Error"/>
Expand Down

0 comments on commit 054deab

Please sign in to comment.