このプログラムを仮定すると:
#include <stdio.h>
#include <string.h>
static void ring_pool_alloc(void **p, size_t n) {
static unsigned char pool[256], i = 0;
*p = &pool[i];
i += n;
}
int main(void) {
char *str;
ring_pool_alloc(&str, 7);
strcpy(str, "foobar");
printf("%s\n", str);
return 0;
}
...どういうわけかGCC警告を回避することは可能ですか
test.c:12: warning: passing argument 1 of ‘ring_pool_alloc’ from incompatible pointer type
test.c:4: note: expected ‘void **’ but argument is of type ‘char **’
... (void**) にキャストせずに (または単に互換性チェックを無効にして)? indirection-level に関する互換性警告を維持したいので...