diff options
author | Manuel Bouyer <bouyer@netbsd.org> | 2021-01-12 19:12:21 +0100 |
---|---|---|
committer | Ian Jackson <iwj@xenproject.org> | 2021-01-28 16:36:48 +0000 |
commit | e8524e4d4d612ef53943f539da2e81785282e5af (patch) | |
tree | 5c6a93c61eca4479f151634eec38fba5d75244de | |
parent | 6e2046378086d2eaf3f1fe807a2fd697f2630f40 (diff) |
Fix error: array subscript has type 'char'
Use unsigned char variable, or cast to (unsigned char), for
tolower()/islower() and friends. Fix compiler error
array subscript has type 'char' [-Werror=char-subscripts]
Signed-off-by: Manuel Bouyer <bouyer@netbsd.org>
Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r-- | tools/libs/light/libxl_qmp.c | 2 | ||||
-rw-r--r-- | tools/xentrace/xentrace.c | 2 | ||||
-rw-r--r-- | xen/tools/symbols.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/tools/libs/light/libxl_qmp.c b/tools/libs/light/libxl_qmp.c index c394000ea9..9b638e6f54 100644 --- a/tools/libs/light/libxl_qmp.c +++ b/tools/libs/light/libxl_qmp.c @@ -1249,7 +1249,7 @@ static int qmp_error_class_to_libxl_error_code(libxl__gc *gc, se++; continue; } - if (tolower(*s) != tolower(*se)) + if (tolower((unsigned char)*s) != tolower((unsigned char)*se)) break; s++, se++; } diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c index 4b50b8a53e..a8903ebf46 100644 --- a/tools/xentrace/xentrace.c +++ b/tools/xentrace/xentrace.c @@ -957,7 +957,7 @@ static int parse_cpumask_range(const char *mask_str, xc_cpumap_t map) { unsigned int a, b; int nmaskbits; - char c; + unsigned char c; int in_range; const char *s; diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c index 9f9e2c9900..0b12452616 100644 --- a/xen/tools/symbols.c +++ b/xen/tools/symbols.c @@ -173,11 +173,11 @@ static int read_symbol(FILE *in, struct sym_entry *s) /* include the type field in the symbol name, so that it gets * compressed together */ s->len = strlen(str) + 1; - if (islower(stype) && filename) + if (islower((unsigned char)stype) && filename) s->len += strlen(filename) + 1; s->sym = malloc(s->len + 1); sym = SYMBOL_NAME(s); - if (islower(stype) && filename) { + if (islower((unsigned char)stype) && filename) { sym = stpcpy(sym, filename); *sym++ = '#'; } |