target/hexagon: suppress unused variable warning
authorAlessandro Di Federico <ale@rev.ng>
Wed, 21 Dec 2022 15:53:27 +0000 (16:53 +0100)
committerTaylor Simpson <tsimpson@quicinc.com>
Thu, 5 Jan 2023 17:19:02 +0000 (09:19 -0800)
This patch manually suppresses a warning for an unused variable
(yynerrs) emitted by bison.

This warning has been triggered for the first time by clang 15.

This patch also disables `-Wextra`, which is not usually adopted in
QEMU. However, clang 15 triggers the warning fixed in this patch even in
absence of `-Wextra`.

Signed-off-by: Alessandro Di Federico <ale@rev.ng>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Tested-by: Taylor Simpson <tsimpson@quicinc.com>
Message-Id: <20221221155327.1504117-1-ale@rev.ng>

target/hexagon/idef-parser/idef-parser.y
target/hexagon/meson.build

index 8be44a0ad17797a36f72dd8e194d1ad0a0c74f79..c14cb3950054417990667e3e934351fc7b040aef 100644 (file)
@@ -99,6 +99,8 @@
 /* Input file containing the description of each hexagon instruction */
 input : instructions
       {
+          /* Suppress warning about unused yynerrs */
+          (void) yynerrs;
           YYACCEPT;
       }
       ;
index e8f250fcac57e7c8c43ed41ab4d639a890059705..c9d31d095caaba9f86bf56d1f08ed2f28aa8c976 100644 (file)
@@ -197,7 +197,6 @@ if idef_parser_enabled and 'hexagon-linux-user' in target_dirs
          idef_parser_dir / 'parser-helpers.c'],
         include_directories: ['idef-parser', '../../include/'],
         dependencies: [glib_dep],
-        c_args: ['-Wextra'],
         native: true
     )