qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/1] target/hexagon: work around unused variable in yyparser


From: Zongyuan Li
Subject: [PATCH 1/1] target/hexagon: work around unused variable in yyparser
Date: Sat, 31 Dec 2022 17:19:35 +0800

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]