I felt its to do with stack variables in Arduino and ran a sample code.
The code prints 3 lines, first is the address of p1 and then the values of p2, p3 respectively as 8 and 9.
However the moment we disable the print_addr by making '#if 0' the p2 and p3 are printed as 9 and 0.
Interesting, but why?
void setup() {
// put your setup code here, to run once:
Serial.begin(38400);
uint8_t p1 = 8;
uint8_t p2 = 9;
uint8_t* p = (void*) &p2;
#if 1
uint16_t print_addr = &p1;
Serial.println(print_addr, HEX);
#endif
Serial.println(*p);
p++;
Serial.println(*p);
}
void loop() {
// put your main code here, to run repeatedly:
}