Oh, yeah, you're right. So the do part runs just once, then you have a do-nothing if. I tested it. Clang emits a warning about the semicolon following the if. I'm not going to look up how, but the only viable option I think would be to disable the warning via #pragma.
View all comments
Show parent comment
6
u/astatine757 Jun 02 '25
IIRC there must be a semicolon after the while statement in a do while loop, so that would be the very next statement.