Sujet : Re: C23 thoughts and opinions
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : comp.lang.cDate : 04. Jun 2024, 22:47:38
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v3o21r$jh5h$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla Thunderbird
On 6/4/2024 1:36 AM, David Brown wrote:
[...]
Personally, I'm in the "while (true) { ... }" camp. To me, "for (;;)" looks like a weird smiley, and I do not fall for any appeals to Deniis Ritchie's authority.
Writing for (;;) is what I personally tend to write, however if a team does not like that, well, I will use while (true), or whatever... I think I tend to write for (;;) because I can adapt it for something like:
for (unsigned long long i = 0; ; ++i)
{
//...
}
So, I can get a running counter (i) or something... Oh well.
But we are missing another option:
void mainloop() {
// do something
mainloop();
}
That should be fine with an optimising compiler.
Still worry about run away recursion...