From: Willy Tarreau Date: Wed, 3 May 2023 14:28:54 +0000 (+0200) Subject: BUILD: cli: fix build on Windows due to isalnum() implemented as a macro X-Git-Tag: v2.8-dev10~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ff508f12c6de47cdab3840ce7c11c6e1fcf10a71;p=thirdparty%2Fhaproxy.git BUILD: cli: fix build on Windows due to isalnum() implemented as a macro Commit 986798718 ("DEBUG: cli: add "debug dev task" to show/wake/expire/kill tasks and tasklets") broke the build on windows due to this: src/debug.c:940:95: error: array subscript has type char [-Werror=char-subscripts] 940 | caller && may_access(caller) && may_access(caller->func) && isalnum(*caller->func) ? caller->func : "0", | ^~~~~~~~~~~~~ It's classical on platforms which implement ctype.h as macros instead of functions, let's cast it as uchar. No backport is needed. --- diff --git a/src/debug.c b/src/debug.c index b196fec244..a68c45df75 100644 --- a/src/debug.c +++ b/src/debug.c @@ -937,7 +937,7 @@ static int debug_parse_cli_task(char **args, char *payload, struct appctx *appct memprintf(&msg, "%s%p: %s state=%#x tid=%d process=%s ctx=%p calls=%d last=%s:%d intl=%d", msg ? msg : "", t, (t->state & TASK_F_TASKLET) ? "tasklet" : "task", t->state, t->tid, trash.area, t->context, t->calls, - caller && may_access(caller) && may_access(caller->func) && isalnum(*caller->func) ? caller->func : "0", + caller && may_access(caller) && may_access(caller->func) && isalnum((uchar)*caller->func) ? caller->func : "0", caller ? t->caller->line : 0, (t->state & TASK_F_TASKLET) ? LIST_INLIST(&((const struct tasklet *)t)->list) : 0);