GCC gives me folowing warning:
note: expected 'const void **' but argument is of type 'const struct auth **
Is there any case, where it could cause problems?
Bigger snippet is
struct auth *current;
gl_list_iterator_next(&it, ¤t, NULL);
Function just stores in current some void * pointer.
The error message is clear enough: you are passing a
struct auth **where avoid **was accepted. There is no implicit conversion between these types as avoid*may not have the same size and alignment as other pointer types.The solution is to use an intermediate
void*:EDIT: to address the comments below, here’s an example of why this is necessary. Suppose you’re on a platform where
sizeof(struct auth*) == sizeof(short) == 2, whilesizeof(void*) == sizeof(long) == 4; that’s allowed by the C standard and platforms with varying pointer sizes actually exist. Then the OP’s code would be similar to doingHowever, this program too can be made to work by introducing an intermediate
long(although the result may only be meaningful when thelong‘s value is small enough to store in ashort).