I've done this before, but usually take modulo 8 rather than bitwise-and negative 7 as the final step.
void *p = x; p += 7; p -= (p%8);
void *p = x; p += 7; p &= ~7;