examples: drop warning silencers no longer hit

Also:
- scope clang `-Wcast-function-type-strict` silencing, add missed `pop`.

Follow-up to d06b49d8b2 #18260

Closes #20896
This commit is contained in:
Viktor Szakats 2026-03-12 00:25:48 +01:00
parent 435eabeac8
commit 56739855f3
No known key found for this signature in database
2 changed files with 7 additions and 13 deletions

View file

@ -34,15 +34,6 @@
#include <curl/curl.h>
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic ignored "-Woverlength-strings"
#endif
/* Silence warning when calling sk_X509_INFO_pop_free() */
#if defined(__clang__) && __clang_major__ >= 16
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
#endif
#if defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC)
typedef size_t ossl_valsize_t;
#else
@ -116,7 +107,14 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *pointer)
}
}
#if defined(__clang__) && __clang_major__ >= 16
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-function-type-strict"
#endif
sk_X509_INFO_pop_free(inf, X509_INFO_free);
#if defined(__clang__) && __clang_major__ >= 16
#pragma clang diagnostic pop
#endif
result = CURLE_OK;

View file

@ -40,10 +40,6 @@
#include <curl/curl.h>
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic ignored "-Woverlength-strings"
#endif
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *stream)
{
fwrite(ptr, size, nmemb, (FILE *)stream);