(volatile void *) memset(a, 0, 3)
But there's a safer and clearer approach I'd probably actually use (although also untested):
volatile void *prevent_optimization = memset(a, 0, 3);
I'm also not sure of erydo's approach. Given "volatile int x", is "(x+1)" a volatile access? I cannot clarify that with ANSI C99.