> -----Original Message-----
> From: Alessandro Di Federico <a...@rev.ng>
> Sent: Wednesday, December 21, 2022 4:03 AM
> To: qemu-devel@nongnu.org
> Cc: Philippe Mathieu-Daudé <phi...@linaro.org>; Taylor Simpson
> <tsimp...@quicinc.com>; Anton Johansson <a...@rev.ng>; Alessandro Di
> Federico <a...@rev.ng>
> Subject: [PATCH] target/hexagon: suppress unused variable warning
>
> 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 <a...@rev.ng>
> ---
> target/hexagon/idef-parser/idef-parser.y | 2 ++
> target/hexagon/meson.build | 1 -
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/target/hexagon/idef-parser/idef-parser.y b/target/hexagon/idef-
> parser/idef-parser.y
> index 8be44a0ad17..de61f48a628 100644
> --- a/target/hexagon/idef-parser/idef-parser.y
> +++ b/target/hexagon/idef-parser/idef-parser.y
> @@ -99,6 +99,8 @@
> /* Input file containing the description of each hexagon instruction */
> input :
> instructions
> {
> + // Suppress warning about unused yynerrs
> + (void) yynerrs;
> YYACCEPT;
> }
> ;
According to this page
https://qemu-project.gitlab.io/qemu/devel/style.html#comment-style
we should avoid // comments, and the checkpatch script will warn about this.
However, checkpatch does not warn on this patch.
Reviewed-by: Taylor Simpson <tsimp...@quicinc.com>
Tested-by: Taylor Simpson <tsimp...@quicinc.com>