diff --git a/examples/c++/variant-11.yy b/examples/c++/variant-11.yy index c83ac6a2..7d883232 100644 --- a/examples/c++/variant-11.yy +++ b/examples/c++/variant-11.yy @@ -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 (*argv[1]))) { auto maxl = strtol (argv[1], nullptr, 10); max = INT_MIN <= maxl && maxl <= INT_MAX ? int(maxl) : 4; diff --git a/examples/c/bistromathic/parse.y b/examples/c/bistromathic/parse.y index d20d4857..8db9d457 100644 --- a/examples/c/bistromathic/parse.y +++ b/examples/c/bistromathic/parse.y @@ -363,7 +363,7 @@ yyreport_syntax_error (const yypcontext_t *ctx) } // %0e, %1e...: expected token. else if (format[0] == '%' - && isdigit (format[1]) + && isdigit ((unsigned char) format[1]) && format[2] == 'e' && (format[1] - '0') < argsize) { diff --git a/src/complain.c b/src/complain.c index 4dc134b8..6a78d40e 100644 --- a/src/complain.c +++ b/src/complain.c @@ -23,7 +23,7 @@ #include "system.h" #include -#include +#include #include #include #include @@ -609,7 +609,7 @@ syntax_error (location loc, while (*format) if (format[0] == '%' - && isdigit (format[1]) + && c_isdigit (format[1]) && format[2] == '$' && format[3] == 's' && (format[1] - '0') < argc) diff --git a/src/fixits.c b/src/fixits.c index 37a0b7dd..2c900254 100644 --- a/src/fixits.c +++ b/src/fixits.c @@ -124,10 +124,11 @@ fixits_run (void) FILE *out = xfopen (input, "w"); size_t line = 1; size_t offset = 1; - fixit const *f = NULL; + void const *p = NULL; gl_list_iterator_t iter = gl_list_iterator (fixits); - while (gl_list_iterator_next (&iter, (const void**) &f, NULL)) + while (gl_list_iterator_next (&iter, &p, NULL)) { + fixit const *f = p; /* Look for the correct line. */ while (line < f->location.start.line) { diff --git a/src/lalr.c b/src/lalr.c index 8b8724d0..ee6c7cf6 100644 --- a/src/lalr.c +++ b/src/lalr.c @@ -92,7 +92,7 @@ goto_print (goto_number i, FILE *out) const state_number dst = to_state[i]; symbol_number var = states[dst]->accessing_symbol; fprintf (out, - "goto[%ld] = (%d, %s, %d)", i, src, symbols[var]->tag, dst); + "goto[%zu] = (%d, %s, %d)", i, src, symbols[var]->tag, dst); } void