Author: brane Date: Sun Jul 6 11:25:28 2025 New Revision: 1926994 URL: http://svn.apache.org/viewvc?rev=1926994&view=rev Log: Fix two more warnings.
* buckets/headers_buckets.c (select_value): The "unreachable" default case could did not set the value of '*len' before returning, causing gcc to be confused. Make it a synonim for the READ_DONE case, since there can be no other enum value here. (serf_bucket_headers_get): Make 'value_size' an apr_size_t, since that's how it is used; avoids narrowing conversion warnings. Modified: serf/trunk/buckets/headers_buckets.c Modified: serf/trunk/buckets/headers_buckets.c URL: http://svn.apache.org/viewvc/serf/trunk/buckets/headers_buckets.c?rev=1926994&r1=1926993&r2=1926994&view=diff ============================================================================== --- serf/trunk/buckets/headers_buckets.c (original) +++ serf/trunk/buckets/headers_buckets.c Sun Jul 6 11:25:28 2025 @@ -160,7 +160,7 @@ const char *serf_bucket_headers_get( headers_context_t *ctx = headers_bucket->data; header_list_t *found = ctx->list; const char *val = NULL; - int value_size = 0; + apr_size_t value_size = 0; int val_alloc = 0; while (found) { @@ -308,10 +308,10 @@ static void select_value( l = 2; break; case READ_DONE: - *len = 0; - return; + /* ctx->state can have no other value here, but fall through to the + default anyway, so that *len is initialized before we return. */ default: - /* Not reachable */ + *len = 0; return; }