In some C project, I have seen this code:
static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
(void)ud;
(void)osize;
/* some code not using `ud` or `osize` */
return ptr;
}
Do the two casts to void serve any purpose?
It is there to avoid warnings from the compiler because some parameters are unused.