summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-10-03 09:26:48 +0200
committerAkim Demaille <akim.demaille@gmail.com>2019-10-03 09:27:40 +0200
commitd96fff6115c5ddc17e7edc1163d42edbdfd9a248 (patch)
tree514c68bae11eeb4bd536d9775a160a2fb9257a90 /tests
parentbe92ad1eb4fc3b665b1bb4eda82e4c744e501765 (diff)
downloadbison-d96fff6115c5ddc17e7edc1163d42edbdfd9a248.tar.gz
tests: be robust to -DNDEBUG
input.y: In function 'yylex': input.y:67:7: error: unused variable 'input_elts' [-Werror=unused-variable] int input_elts = sizeof input / sizeof input[0]; ^~~~~~~~~~ cc1: all warnings being treated as errors * tests/input.at, tests/local.at: Avoid that.
Diffstat (limited to 'tests')
-rw-r--r--tests/input.at1
-rw-r--r--tests/local.at1
2 files changed, 2 insertions, 0 deletions
diff --git a/tests/input.at b/tests/input.at
index ffe89881..7174159b 100644
--- a/tests/input.at
+++ b/tests/input.at
@@ -1321,6 +1321,7 @@ yylex (void)
#output "; /* "
*/
enum { input_elts = sizeof input };
+ (void) input_elts;
static ptrdiff_t toknum;
assert (0 <= toknum && toknum < input_elts);
yylval = value_as_yystype (input[toknum]);
diff --git a/tests/local.at b/tests/local.at
index fee44382..17759b2f 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -559,6 +559,7 @@ static
int res;
]AT_USE_LEX_ARGS[
int input_elts = sizeof input / sizeof input[0];
+ (void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
]$2[;]AT_TOKEN_CTOR_IF([], [[