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.
This commit is contained in:
Akim Demaille
2019-10-03 09:26:48 +02:00
parent be92ad1eb4
commit d96fff6115
2 changed files with 2 additions and 0 deletions

View File

@@ -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]);

View File

@@ -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([], [[