All of lore.kernel.org
 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

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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.