* [PATCH] target/hexagon: suppress unused variable warning
@ 2022-12-21 10:02 Alessandro Di Federico via
2022-12-21 10:13 ` Philippe Mathieu-Daudé
2022-12-21 15:43 ` Taylor Simpson
0 siblings, 2 replies; 4+ messages in thread
From: Alessandro Di Federico via @ 2022-12-21 10:02 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Taylor Simpson, Anton Johansson,
Alessandro Di Federico
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>
---
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;
}
;
diff --git a/target/hexagon/meson.build b/target/hexagon/meson.build
index e8f250fcac5..c9d31d095ca 100644
--- a/target/hexagon/meson.build
+++ b/target/hexagon/meson.build
@@ -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
)
--
2.38.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] target/hexagon: suppress unused variable warning
2022-12-21 10:02 [PATCH] target/hexagon: suppress unused variable warning Alessandro Di Federico via
@ 2022-12-21 10:13 ` Philippe Mathieu-Daudé
2022-12-21 15:43 ` Taylor Simpson
1 sibling, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-21 10:13 UTC (permalink / raw)
To: Alessandro Di Federico, qemu-devel; +Cc: Taylor Simpson, Anton Johansson
On 21/12/22 11:02, Alessandro Di Federico wrote:
> 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>
> ---
> target/hexagon/idef-parser/idef-parser.y | 2 ++
> target/hexagon/meson.build | 1 -
> 2 files changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] target/hexagon: suppress unused variable warning
2022-12-21 10:02 [PATCH] target/hexagon: suppress unused variable warning Alessandro Di Federico via
2022-12-21 10:13 ` Philippe Mathieu-Daudé
@ 2022-12-21 15:43 ` Taylor Simpson
2022-12-21 17:42 ` Richard Henderson
1 sibling, 1 reply; 4+ messages in thread
From: Taylor Simpson @ 2022-12-21 15:43 UTC (permalink / raw)
To: Alessandro Di Federico, qemu-devel@nongnu.org
Cc: Philippe Mathieu-Daudé, Anton Johansson
> -----Original Message-----
> From: Alessandro Di Federico <ale@rev.ng>
> Sent: Wednesday, December 21, 2022 4:03 AM
> To: qemu-devel@nongnu.org
> Cc: Philippe Mathieu-Daudé <philmd@linaro.org>; Taylor Simpson
> <tsimpson@quicinc.com>; Anton Johansson <anjo@rev.ng>; Alessandro Di
> Federico <ale@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 <ale@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 <tsimpson@quicinc.com>
Tested-by: Taylor Simpson <tsimpson@quicinc.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] target/hexagon: suppress unused variable warning
2022-12-21 15:43 ` Taylor Simpson
@ 2022-12-21 17:42 ` Richard Henderson
0 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2022-12-21 17:42 UTC (permalink / raw)
To: Taylor Simpson, Alessandro Di Federico, qemu-devel@nongnu.org
Cc: Philippe Mathieu-Daudé, Anton Johansson
On 12/21/22 07:43, Taylor Simpson wrote:
>> --- 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.
It does not process *.y.
r~
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-21 17:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-21 10:02 [PATCH] target/hexagon: suppress unused variable warning Alessandro Di Federico via
2022-12-21 10:13 ` Philippe Mathieu-Daudé
2022-12-21 15:43 ` Taylor Simpson
2022-12-21 17:42 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).