[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
yacc.c, lalr1.cc: fix warnings about yynerrs
From: |
Akim Demaille |
Subject: |
yacc.c, lalr1.cc: fix warnings about yynerrs |
Date: |
Tue, 2 Aug 2022 09:09:07 +0200 |
commit a166d5450e3f47587b98f6005f9f5627dbe21a5b
Author: Akim Demaille <akim.demaille@gmail.com>
Date: Tue Aug 2 08:45:25 2022 +0200
yacc.c, lalr1.cc: fix warnings about yynerrs
Most often yynerrs is not used. Clang 15 now complains about such
variables. Bison itself does not compile:
```
src/parse-gram.c:1797:9: error: variable 'gram_nerrs' set but not used
[-Werror,-Wunused-but-set-variable]
int yynerrs = 0;
^
src/parse-gram.c:79:25: note: expanded from macro 'yynerrs'
^
1 error generated.
```
Reported by Nikita Popov.
Fixes https://github.com/akimd/bison/issues/89.
* data/skeletons/yacc.c (yynerrs): Flag with YY_ATTRIBUTE_UNUSED.
* data/skeletons/lalr1.cc (yynerrs_): Likewise.
diff --git a/THANKS b/THANKS
index 8ab72096..391b847e 100644
--- a/THANKS
+++ b/THANKS
@@ -46,8 +46,8 @@ Csaba Raduly csaba_22@yahoo.co.uk
Dagobert Michelsen dam@baltic-online.de
Daniel Frużyński daniel@poradnik-webmastera.com
Daniel Galloway dg1751@att.com
-Daniela Becker daniela@lrde.epita.fr
Daniel Hagerty hag@gnu.org
+Daniela Becker daniela@lrde.epita.fr
David Barto david.barto@sparqlcity.com
David J. MacKenzie djm@gnu.org
David Kastrup dak@gnu.org
@@ -143,6 +143,7 @@ Nick Bowler nbowler@elliptictech.com
Nicolas Bedon nicolas.bedon@univ-rouen.fr
Nicolas Burrus nicolas.burrus@epita.fr
Nicolas Tisserand nicolas.tisserand@epita.fr
+Nikita Popov nikic@php.net
Nikki Valen nicolettavalencia.nv@gmail.com
Noah Friedman friedman@gnu.org
Odd Arild Olsen oao@fibula.no
@@ -170,7 +171,6 @@ Quoc Peyrot chojin@lrde.epita.fr
R Blake blakers@mac.com
Raja R Harinath harinath@cs.umn.edu
Ralf Wildenhues Ralf.Wildenhues@gmx.de
-Ryan dev@splintermail.com
Rich Wilson richaw@gmail.com
Richard Stallman rms@gnu.org
Rici Lake ricilake@gmail.com
@@ -179,6 +179,7 @@ Rob Vermaas rob.vermaas@gmail.com
Robert Anisko anisko_r@epita.fr
Robert Yang liezhi.yang@windriver.com
Roland Levillain roland@lrde.epita.fr
+Ryan dev@splintermail.com
Satya Kiran Popuri satyakiran@gmail.com
Sebastian Setzer sebastian.setzer.ext@siemens.com
Sebastien Fricker sebastien.fricker@gmail.com
diff --git a/data/skeletons/lalr1.cc b/data/skeletons/lalr1.cc
index 240f4c36..4242b992 100644
--- a/data/skeletons/lalr1.cc
+++ b/data/skeletons/lalr1.cc
@@ -847,7 +847,7 @@ m4_if(b4_prefix, [yy], [],
int yylen = 0;
// Error handling.
- int yynerrs_ = 0;
+ int yynerrs_ YY_ATTRIBUTE_UNUSED = 0;
int yyerrstatus_ = 0;
/// The lookahead symbol.
diff --git a/data/skeletons/yacc.c b/data/skeletons/yacc.c
index fd7e2c33..07a523b0 100644
--- a/data/skeletons/yacc.c
+++ b/data/skeletons/yacc.c
@@ -256,7 +256,7 @@ int yynerrs;]])])
m4_define([b4_declare_parser_state_variables],
[b4_pure_if([[
/* Number of syntax errors so far. */
- int yynerrs]m4_ifval([$1], [ = 0])[;
+ int yynerrs YY_ATTRIBUTE_UNUSED]m4_ifval([$1], [ = 0])[;
]])[
yy_state_fast_t yystate]m4_ifval([$1], [ = 0])[;
/* Number of tokens to shift before error messages enabled. */
commit 5555f4d05163316b8b5bddbdb172c0f5bae6f765
Author: Akim Demaille <akim.demaille@gmail.com>
Date: Tue Aug 2 09:00:47 2022 +0200
regen
diff --git a/src/parse-gram.c b/src/parse-gram.c
index 400e89b7..b6ac083e 100644
--- a/src/parse-gram.c
+++ b/src/parse-gram.c
@@ -1,9 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.8.1. */
+/* A Bison parser, made by GNU Bison 3.8.2.30-82269. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2022 Free Software
- Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2022 Free Software
Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,10 +46,10 @@
USER NAME SPACE" below. */
/* Identify Bison output, and Bison version. */
-#define YYBISON 30801
+#define YYBISON 30802
/* Bison version string. */
-#define YYBISON_VERSION "3.8.1"
+#define YYBISON_VERSION "3.8.2.30-82269"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -1794,7 +1794,7 @@ static YYLTYPE yyloc_default
YYLTYPE yylloc = yyloc_default;
/* Number of syntax errors so far. */
- int yynerrs = 0;
+ int yynerrs YY_ATTRIBUTE_UNUSED = 0;
yy_state_fast_t yystate = 0;
/* Number of tokens to shift before error messages enabled. */
diff --git a/src/parse-gram.h b/src/parse-gram.h
index 55837bc4..5170e08c 100644
--- a/src/parse-gram.h
+++ b/src/parse-gram.h
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.8.1. */
+/* A Bison parser, made by GNU Bison 3.8.2.30-82269. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software
Foundation,
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2022 Free Software
Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- yacc.c, lalr1.cc: fix warnings about yynerrs,
Akim Demaille <=