Yes. what you describe is perfectly normal optimizer behavior - and therefore not annoying, but desirable.
The "volatile" type qualifier exists for a reason. Oversimplified, every variable that can may change spontaneously (e.g., because it is written from within an interrupt handler or callback, or because it actually is hardware register) must be declared volatile.
The "volatile" type qualifier exists for a reason. Oversimplified, every variable that can may change spontaneously (e.g., because it is written from within an interrupt handler or callback, or because it actually is hardware register) must be declared volatile.
Code:
static volatile uint64_t last_time = 0;static volatile uint64_t time = 0;static volatile bool edge = false;Statistics: Posted by czietz — Tue Jun 03, 2025 5:37 am