It's not exactly clear to me why gcc warns about this (and it's hard to find reference for this specific flavor of -Waddress), but my understanding is that arithmetic on well-defined pointers will never yield NULL. Of course, we are not dealing with well-defined pointers here, but fortunately gcc does not complain if we cast to intptr_t first.