volatile
is to tell the compiler not to optimize the reference, so that every read/write does not use the value stored in register but does a real memory access
This code volatile int *p = some_addr
declares a pointer to a volatile int
. The pointer itself is not volatile
.
In the unlikely event that you needed the pointer to be volatile as well as the int, you would need to use:
volatile int * volatile p;
I can't think of a situation where you would need to use that.