I have a function with a prototype like this:
ErrorType function(void ** parameter, other_args);
This function reads the pointer pointed by 'parameter' and changes it (think of it like a realloc).
Now, to be right according to the C Standard, if I want to pass the address of other pointer than a void *, I must declare a temporary void * variable and use that instead.
So that I want is to create a wrapper (I don't care if it's a function or a macro), that do the function call with any pointer type.
I think I could do that in C11 with _Generic and a function for each basic type, plus a function for all structs and a function for all unions, but I think it's too troublesome.
I also read about a GCC extension that let you to write statements and declarations in expressions, and I think that I can easily do that I want with that, but I prefer that my code compiles in all standard compilers, not only in GCC or Clang.
So the question is, is there any way to do that without too much problems in a C11 compiler?