diff --git a/src/cfgrammar.c b/src/cfgrammar.c
index b33ad86220321db0410b914daab81c00648b5613..ab7388302b24c9bb1c8767fc5d66e990fa39c165 100644
--- a/src/cfgrammar.c
+++ b/src/cfgrammar.c
@@ -648,7 +648,7 @@ void h_pprint_char(FILE *f, char c)
   case '\n': fputs("\\n", f); break;
   case '\r': fputs("\\r", f); break;
   default:
-    if(isprint(c)) {
+    if(isprint((int)c)) {
       fputc(c, f);
     } else {
       fprintf(f, "\\x%.2X", c);
diff --git a/src/parsers/whitespace.c b/src/parsers/whitespace.c
index 737affde3bad042e057b8a6c6c1f983116b18786..e37aa12e8c35640a6f69a1d98393ec64d4c3b419 100644
--- a/src/parsers/whitespace.c
+++ b/src/parsers/whitespace.c
@@ -10,7 +10,7 @@ static HParseResult* parse_whitespace(void* env, HParseState *state) {
     c = h_read_bits(&state->input_stream, 8, false);
     if (state->input_stream.overrun)
       break;
-  } while (isspace(c));
+  } while (isspace((int)c));
   state->input_stream = bak;
   return h_do_parse((HParser*)env, state);
 }