Author: brane Date: Fri May 30 16:44:51 2025 New Revision: 1925991 URL: http://svn.apache.org/viewvc?rev=1925991&view=rev Log: Compiler warning cleanup. In this chapter: - non-static functions without prototypes; - global variables without extern declarations; - argument type mismatch in printf-like function calls.
* auth/auth_spnego.c (serf__validate_response_spnego_auth): Make this function static, it's only used within this compilation unit. * auth/auth_spnego_gss.c (log_error): Cast a log argument to char* to match the format string. (serf__spnego_init_sec_context): Likewise. (serf__fake__auth_spnego_gas_c): Add extern declaration. * auth/auth_spnego_sspi.c (serf__fake__auth_spnego_sspi_c): Add extern declaration. * src/logging.c (loglvl_labels): Make static and const. * test/MockHTTPinC/MockHTTP_server.c (BufferedSocketBucketType): Make static. Modified: serf/trunk/auth/auth_spnego.c serf/trunk/auth/auth_spnego_gss.c serf/trunk/auth/auth_spnego_sspi.c serf/trunk/buckets/log_wrapper_buckets.c serf/trunk/src/logging.c serf/trunk/test/MockHTTPinC/MockHTTP_server.c Modified: serf/trunk/auth/auth_spnego.c URL: http://svn.apache.org/viewvc/serf/trunk/auth/auth_spnego.c?rev=1925991&r1=1925990&r2=1925991&view=diff ============================================================================== --- serf/trunk/auth/auth_spnego.c (original) +++ serf/trunk/auth/auth_spnego.c Fri May 30 16:44:51 2025 @@ -583,7 +583,7 @@ get_auth_header(serf_bucket_t *hdrs, * authentication handshake. This specific response includes authentication * data which should be validated by the client (mutual authentication). */ -apr_status_t +static apr_status_t serf__validate_response_spnego_auth(const serf__authn_scheme_t *scheme, peer_t peer, int code, Modified: serf/trunk/auth/auth_spnego_gss.c URL: http://svn.apache.org/viewvc/serf/trunk/auth/auth_spnego_gss.c?rev=1925991&r1=1925990&r2=1925991&view=diff ============================================================================== --- serf/trunk/auth/auth_spnego_gss.c (original) +++ serf/trunk/auth/auth_spnego_gss.c Fri May 30 16:44:51 2025 @@ -78,7 +78,7 @@ log_error(int verbose_flag, serf_config_ serf__log(verbose_flag, LOGCOMP_AUTHN, __FILE__, config, "%s (%x,%d): %s\n", msg, - err_maj_stat, err_min_stat, stat_buff.value); + err_maj_stat, err_min_stat, (const char *)stat_buff.value); gss_release_buffer(&min_stat, &stat_buff); } } @@ -175,7 +175,7 @@ serf__spnego_init_sec_context(serf_conne bufdesc.value = apr_pstrcat(scratch_pool, service, "@", hostname, NULL); bufdesc.length = strlen(bufdesc.value); serf__log(LOGLVL_DEBUG, LOGCOMP_AUTHN, __FILE__, conn->config, - "Get principal for %s\n", bufdesc.value); + "Get principal for %s\n", (const char *)bufdesc.value); gss_maj_stat = gss_import_name (&gss_min_stat, &bufdesc, GSS_C_NT_HOSTBASED_SERVICE, &host_gss_name); @@ -233,5 +233,6 @@ serf__spnego_init_sec_context(serf_conne #else /* SERF_USE_GSSAPI */ /* Prevent "object has no symbols" warnings from ranlib on macOS. */ +extern const long serf__fake__auth_spnego_gas_c; const long serf__fake__auth_spnego_gas_c = 0xdeadbeef; #endif /* SERF_USE_GSSAPI */ Modified: serf/trunk/auth/auth_spnego_sspi.c URL: http://svn.apache.org/viewvc/serf/trunk/auth/auth_spnego_sspi.c?rev=1925991&r1=1925990&r2=1925991&view=diff ============================================================================== --- serf/trunk/auth/auth_spnego_sspi.c (original) +++ serf/trunk/auth/auth_spnego_sspi.c Fri May 30 16:44:51 2025 @@ -302,5 +302,6 @@ serf__spnego_init_sec_context(serf_conne #else /* SERF_USE_SSPI */ /* Prevent "object has no symbols" warnings from ranlib on macOS. */ +extern const long serf__fake__auth_spnego_sspi_c; const long serf__fake__auth_spnego_sspi_c = 0xdeadbeef; #endif /* SERF_USE_SSPI */ Modified: serf/trunk/buckets/log_wrapper_buckets.c URL: http://svn.apache.org/viewvc/serf/trunk/buckets/log_wrapper_buckets.c?rev=1925991&r1=1925990&r2=1925991&view=diff ============================================================================== --- serf/trunk/buckets/log_wrapper_buckets.c (original) +++ serf/trunk/buckets/log_wrapper_buckets.c Fri May 30 16:44:51 2025 @@ -92,8 +92,8 @@ serf_log_wrapped_read_iovec(serf_bucket_ "--- %"APR_SIZE_T_FMT" bytes. --\n", len); for (i = 0; i < *vecs_used; i++) { - serf__log_nopref(LOGLVL_DEBUG, LOGCOMP_RAWMSG, ctx->config, - "%.*s", (int)vecs[i].iov_len, vecs[i].iov_base); + serf__log_nopref(LOGLVL_DEBUG, LOGCOMP_RAWMSG, ctx->config, "%.*s", + (int)vecs[i].iov_len, (const char*)vecs[i].iov_base); } serf__log_nopref(LOGLVL_DEBUG, LOGCOMP_RAWMSG, ctx->config, "\n"); Modified: serf/trunk/src/logging.c URL: http://svn.apache.org/viewvc/serf/trunk/src/logging.c?rev=1925991&r1=1925990&r2=1925991&view=diff ============================================================================== --- serf/trunk/src/logging.c (original) +++ serf/trunk/src/logging.c Fri May 30 16:44:51 2025 @@ -45,7 +45,7 @@ struct serf_log_output_t { void *baton; }; -const char * loglvl_labels[] = { +static const char *const loglvl_labels[] = { "", "ERROR", /* 0x0001 */ "WARN ", /* 0x0002 */ Modified: serf/trunk/test/MockHTTPinC/MockHTTP_server.c URL: http://svn.apache.org/viewvc/serf/trunk/test/MockHTTPinC/MockHTTP_server.c?rev=1925991&r1=1925990&r2=1925991&view=diff ============================================================================== --- serf/trunk/test/MockHTTPinC/MockHTTP_server.c (original) +++ serf/trunk/test/MockHTTPinC/MockHTTP_server.c Fri May 30 16:44:51 2025 @@ -519,7 +519,7 @@ static apr_status_t buffSktPeek(bucket_t return status; } -const _mhBucketType_t BufferedSocketBucketType = { +static const _mhBucketType_t BufferedSocketBucketType = { "BUFFSOCKET", buffSktRead, buffSktReadLine, @@ -3081,4 +3081,3 @@ static apr_status_t sslHandshake(_mhClie #else /* TODO: OpenSSL not available => empty implementations */ #endif -