End Google Ads 201810 - BS.net 01 --> Hi, I read an old program, the programmer wrote some function like the following block, I am wonder if the volatile is necessary with a local variable.

As I know, local variable is in stack, every time enter the function, local variable get a new stack address.

void logRealClock(void){ volatile int second; volatile int minute; volatile int hour; second = globalDate->second; minute = globalDate->minute; hour = globalDate->hour; .... checkTime(second,minute,hour); ... globalRTC_REG.second = second; globalRTC_REG.minute = minute; globalRTC_REG.hour = hour; }