How to wrap libcurl write callback in C++?

Sonar keeps raising issues about a wrapper callback function that must have a certain signature given by libcurl specs, it does not like an argument void*, I get that, but what are the alternatives? I tried this but ended adding the undesirable NOSONAR comment:

    static size_t Write(const char* contents, size_t size, size_t nmemb, /* NOSONAR: required by libcurl */ void* user_data) {
        auto* ctx = static_cast<CurlCallbackContext*>(user_data);
        ctx->body.append(contents, size * nmemb);
        return size * nmemb;
    }

Any guidance much appreciated.
Thank you,
Martin

This is a known issue when a function takes a void* as argument.

A solution would be to use using CurlUserDataPtr = void*; and use CurlUserDataPtr in the signature of the cURL callback functions. Then you only need to accept the usage of void* once instead of every callback function.