I was reading some source code, and this came up;
struct Cookie *
Curl_cookie_add(struct SessionHandle *data, /* rest of params were here */)
{
/* unrelated things were here */
#ifdef CURL_DISABLE_VERBOSE_STRINGS
(void)data;
#endif
/* rest of function goes here */
}
As you can see, void casted pointer, isn’t even assigned to a variable. I was wondering what is the purpose of this.
This cast suppresses a compiler warning that would arise if
datais not used.GCC produces this warning if the
-Wunused-parameterflag (implied by-Wextra) is enabled.