From d96fff6115c5ddc17e7edc1163d42edbdfd9a248 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Thu, 3 Oct 2019 09:26:48 +0200 Subject: [PATCH] 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. --- tests/input.at | 1 + tests/local.at | 1 + 2 files changed, 2 insertions(+) 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([], [[