lib: silence gcc-16 compiler warnings -Wmaybe-uninitialized

Seen in the 'curl-for-win / Windows gcc zlib-classic (x64)' CI job,
after it got an upstream upgrade from gcc-15 to gcc-16:
```
lib/http.c:206:6: error: 'out.str' may be used uninitialized [-Werror=maybe-uninitialized]
  206 |   if(header_has_value(&header, &out)) {
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/api.h:188:3: error: 'guard.data' may be used uninitialized [-Werror=maybe-uninitialized]
  188 |   Curl_mapi_enter((g), (m), CURL_MAPI_FN_##fn, (r)) && (m)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/multi.c:1695:6: note: in expansion of macro 'CURL_MAPI_ENTER'
 1695 |   if(CURL_MAPI_ENTER(&guard, m, multi_poll, &mresult)) {
      |      ^~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/32626356576/job/97162205296#step:3:4906

Closes #22651
This commit is contained in:
Viktor Szakats 2026-08-24 09:27:42 +02:00
parent be459eb4e3
commit a1bca29bdd
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -815,7 +815,7 @@ static CURLcode easy_perform(struct Curl_easy *data, bool events)
*/
CURLcode curl_easy_perform(CURL *curl)
{
struct Curl_eapi_guard guard;
struct Curl_eapi_guard guard = { 0 };
CURLcode result;
if(CURL_EAPI_ENTER(&guard, curl, easy_perform, &result)) {

View file

@ -200,7 +200,7 @@ static bool http_header_is_empty(const char *header)
*/
static CURLcode copy_custom_value(const char *header, char **valp)
{
struct Curl_str out;
struct Curl_str out = { 0 };
/* find the end of the header name */
if(header_has_value(&header, &out)) {