src/test: avoid (void)! constructs

The reason to use them seems to be that just (void) before a function
call is not enough to silence compiler warnings when return codes are
ignored and -Werror=unused-result is used.

While (void)! apparently works to silence those warnings, it is just too
weird and surprising to readers to use.

It is rather a reason to reconsider the usefulness of the warning.

Closes #22023
This commit is contained in:
Daniel Stenberg 2026-06-15 13:52:52 +02:00
parent 9f25dcea55
commit c8d8f081fd
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 11 additions and 6 deletions

View file

@ -226,8 +226,10 @@ static char *c_escape(const char *str, curl_off_t len)
result = curlx_dyn_addn(&escaped, str, s - str);
if(!result)
(void)!curlx_dyn_addn(&escaped, "...", cutoff);
result = curlx_dyn_addn(&escaped, "...", cutoff);
if(result)
return NULL;
return curlx_dyn_ptr(&escaped);
}