Andres Freund <andres@anarazel.de> writes: > Unfortunately foreach(ListCell *lc, ...) doesn't work with the current > definition. Which I think isn't great, because the large scopes for loop > iteration variables imo makes the code harder to reason about.
Totally agree.
you can only put one <declaration> into the first element of a for (;;).
Use an anonymous block outer scope? Or if not permitted even by C99 (which I think it is), a do {...} while (0); hack?