typecheck-gcc: allow passing char[] as callback data

E.g. `TEST_DATA_STRING` in test 655.

Cherry-picked from #22406

Closes #22409
This commit is contained in:
Viktor Szakats 2026-07-27 13:17:56 +02:00
parent 4eb4b0d080
commit c5ad90bf9a
No known key found for this signature in database

View file

@ -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 *) || \