- GitHub
- C++
- (GitHub - cppservergit/httpcli: Modern C++ 23 wrapper for libcurl, core guidelines compliant)
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