From c5ad90bf9a8471987ebb47a05881a51108bcf87f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 27 Jul 2026 13:17:56 +0200 Subject: [PATCH] typecheck-gcc: allow passing `char[]` as callback data E.g. `TEST_DATA_STRING` in test 655. Cherry-picked from #22406 Closes #22409 --- include/curl/typecheck-gcc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/curl/typecheck-gcc.h b/include/curl/typecheck-gcc.h index c70bd17cb8..f2e4542772 100644 --- a/include/curl/typecheck-gcc.h +++ b/include/curl/typecheck-gcc.h @@ -608,9 +608,10 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t, * == or whatsoever. */ -/* XXX: should evaluate to true if expr is a pointer */ +/* XXX: should evaluate to true if expr is a pointer or a char[] array */ #define curlcheck_any_ptr(expr) \ - (sizeof(expr) == sizeof(void *)) + (sizeof(expr) == sizeof(void *) || \ + __builtin_types_compatible_p(__typeof__(expr), char[])) /* evaluates to true if expr is NULL */ /* XXX: must not evaluate expr, so this check is not accurate */ @@ -677,7 +678,7 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t, (__builtin_types_compatible_p(__typeof__(expr), curl_off_t)) /* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ -/* XXX: also check size of an char[] array? */ +/* XXX: also check size of a char[] array? */ #define curlcheck_error_buffer(expr) \ (curlcheck_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), char *) || \