C++ Logo

std-proposals

Advanced search

Re: Remove infinite loop UB

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sun, 10 May 2020 12:02:22 -0400
Corrections to some code. I got my conditions backwards:

> //Spin to wait for VBlank routine
> waiting_for_vblank = 1;
> while(!waiting_for_vblank) {}

The condition should be `while(waiting_for_vblank) {}`.

Also:

> //Busy loop 2:
> waiting_for_vblank = 0;
> while(waiting_for_vblank) {}

The condition should be `while(!waiting_for_vblank) {}`.

Received on 2020-05-10 11:05:30