3 ms·
volatile is tied to a fairly specific usage and does not appear in that many projects. I'd personally go with while -> if, that's very sneaky.
by huhtenberg 15y ago
volatile is tied to a fairly specific usage and does not appear in that many projects.
I'd personally go with while -> if, that's very sneaky.
- ricree 15y agoI'm rusty on my C preprocessor, but how would this work out for do {} while blocks?
- psykotic 15y agoIt will cause compiler errors, so it's not all that sneaky: int main(void) { while (1) break; return 0; }
- huhtenberg 15y agoIt may rather than will. This ^ is a rather odd, syntax abuse case.
- psykotic 15y agoWhat do you mean? You will get a compiler error in any case where there is a break or continue in an outermost while block. There's nothing odd or uncommon about that. Here's something closer to a real program: int main(void) { while (1) { char c = getchar(); if (c == 'q') break; process(c); } return 0; }
- huhtenberg 15y agoUgh. You are right of course. I had a brain spasm.