qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] target/hexagon: work around unused variable in yyparser
@ 2022-12-31  9:19 Zongyuan Li
  2022-12-31 12:48 ` Alessandro Di Federico via
  0 siblings, 1 reply; 2+ messages in thread
From: Zongyuan Li @ 2022-12-31  9:19 UTC (permalink / raw)
  To: Alessandro Di Federico, Anton Johansson, qemu-devel; +Cc: Zongyuan Li

Variable 'yynerrs' is recognized as unused variable in clang15,
which is auto-generated by bison in parser file, as long as user
code doesn't access it in '.y'. This is already fixed in bison 8.2.
But for user who use latest clang, a simple harmless code piece
would fix this building error.

FYI: bison patch link
https://mail.gnu.org/archive/html/bison-patches/2022-08/msg00006.html

Signed-off-by: Zongyuan Li <zongyuan.li@smartx.com>
---
 target/hexagon/idef-parser/idef-parser.y | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/hexagon/idef-parser/idef-parser.y b/target/hexagon/idef-parser/idef-parser.y
index 8be44a0ad1..07aa105aa2 100644
--- a/target/hexagon/idef-parser/idef-parser.y
+++ b/target/hexagon/idef-parser/idef-parser.y
@@ -99,6 +99,9 @@
 /* Input file containing the description of each hexagon instruction */
 input : instructions
       {
+          if (yynerrs != 0) {
+              YYABORT;
+          }
           YYACCEPT;
       }
       ;
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] target/hexagon: work around unused variable in yyparser
  2022-12-31  9:19 [PATCH 1/1] target/hexagon: work around unused variable in yyparser Zongyuan Li
@ 2022-12-31 12:48 ` Alessandro Di Federico via
  0 siblings, 0 replies; 2+ messages in thread
From: Alessandro Di Federico via @ 2022-12-31 12:48 UTC (permalink / raw)
  To: Zongyuan Li; +Cc: Anton Johansson, qemu-devel

On Sat, 31 Dec 2022 17:19:35 +0800
Zongyuan Li <zongyuan.li@smartx.com> wrote:

> Variable 'yynerrs' is recognized as unused variable in clang15,

This issue is already handled by another similar patch (target/hexagon:
suppress unused variable warning) that will soon end up in a pull
request.

Thanks for looking into this though.

-- 
Alessandro Di Federico
rev.ng Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-31 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-31  9:19 [PATCH 1/1] target/hexagon: work around unused variable in yyparser Zongyuan Li
2022-12-31 12:48 ` Alessandro Di Federico via

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).