From 4a895214931899a863641fc36889e225eb1ab70d Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Tue, 13 Aug 2019 17:53:17 +0300 Subject: [PATCH] Use 'int' instead of 'char' for character variables MINIX libc headers define the ctype.h toupper() etc. functions as preprocessor macros that don't cast their argument to int! So a char argument causes clang to say "warning: array subscript is of type 'char'". --- c/read.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/c/read.h b/c/read.h index d366685..0d35748 100644 --- a/c/read.h +++ b/c/read.h @@ -172,7 +172,7 @@ static char buf[256]; static char nextchar(void) { int ch; - char c; + int c; struct ios *f = F; do { @@ -207,7 +207,7 @@ static void accumchar(char c, int *pi) } // return: 1 if escaped (forced to be symbol) -static int read_token(char c, int digits) +static int read_token(int c, int digits) { int i = 0, ch, escaped = 0, issym = 0, first = 1; @@ -244,9 +244,9 @@ static value_t do_read_sexpr(value_t label); static uint32_t peek(void) { - char c, *end; + char *end; fixnum_t x; - int ch, base; + int c, ch, base; if (toktype != TOK_NONE) return toktype;