Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++undefined behavior catalogSingle-choice MCQ

At -O2, why might this loop never terminate even though it looks like it should stop when `i` overflows?

int sum = 0; for (int i = 0; i >= 0; ++i) { sum += i; }