Can I do arithmetic on void * pointers in C?
问题 is this valid void *p = &X; /* some thing */ p += 12; and if so what does p now point to? I have (third party) code that does this (and compiles cleanly) and my guess is that the void * was treated as a char *. My trusty K&R is silent(ish) on the topic EDIT: My little test app runs fine on gcc 4.1.1 and treats void * as char *. But g++ barfs I know how to do it properly. I need to know if I have to clean this code base to find all the places its done. BTW gcc -pedantic throws up a warning