build: fix warnings (shown on IRIX)

Appearing on IRIX with gcc -mabi=n32.
Reported by Bruno Haible.
https://lists.gnu.org/r/bug-bison/2020-05/msg00039.html

* examples/c++/variant-11.yy, examples/c/bistromathic/parse.y: Don't
give chars to isdigit, cast them to unsigned char before.
* src/complain.c: Use c_isdigit.
* src/fixits.c (fixits_run): Avoid casts.
* src/lalr.c (goto_print): Use %zu for a size_t.
This commit is contained in:
Akim Demaille
2020-05-03 17:31:43 +02:00
parent eea56d70d9
commit 292409e91e
5 changed files with 8 additions and 7 deletions

View File

@@ -139,7 +139,7 @@ namespace yy
int
main (int argc, const char *argv[])
{
if (2 <= argc && isdigit (*argv[1]))
if (2 <= argc && isdigit (static_cast<unsigned char> (*argv[1])))
{
auto maxl = strtol (argv[1], nullptr, 10);
max = INT_MIN <= maxl && maxl <= INT_MAX ? int(maxl) : 4;