In a C code, I passed a LJ_6_12_t ** to a function accepting a void ** argument, but received a -Wincompatible-pointer-types warning along with the following "note" when compiling:

note: expected ‘void **’ but argument is of type ‘LJ_6_12_t ** {aka struct **}’

I think with a typecast the warning would disappear, but why does it happen in the first place? Shouldn't a void * variable accept any kind of pointer?

1 Answers

1
alk On

Shouldn't a void * variable accept any kind of pointer?

Yes it should and will, but you pass to a void**, which is not the same as a void*.