yacc.c: work around warnings from G++ 4.8

input.c: In function 'int yyparse()':
input.c: error: conversion to 'long int' from 'long unsigned int'
                may change the sign of the result [-Werror=sign-conversion]
   yyes_capacity = sizeof yyesa / sizeof *yyes;
                                ^
cc1plus: all warnings being treated as errors

* data/skeletons/yacc.c: here.
This commit is contained in:
Akim Demaille
2019-10-05 22:51:16 +02:00
parent 5973d763c0
commit 32e5a91a91
2 changed files with 23 additions and 4 deletions

View File

@@ -1154,10 +1154,10 @@ yytnamerr (char *yyres, const char *yystr)
do_not_strip_quotes: ;
}
if (! yyres)
if (yyres)
return (YYPTRDIFF_T) (yystpcpy (yyres, yystr) - yyres);
else
return yystrlen (yystr);
return yystpcpy (yyres, yystr) - yyres;
}
# endif
@@ -1490,7 +1490,7 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
yystacksize = YYINITDEPTH;]b4_lac_if([[
yyes = yyesa;
yyes_capacity = sizeof yyesa / sizeof *yyes;
yyes_capacity = (YYPTRDIFF_T) (sizeof yyesa / sizeof *yyes);
if (YYMAXDEPTH < yyes_capacity)
yyes_capacity = YYMAXDEPTH;]])[