Liste des Groupes | Revenir à cl c |
On 14/03/2025 21:10, Keith Thompson wrote:
>Tim Rentsch <tr.17687@z991.linuxsc.com> writes:>
>Richard Harnden <richard.nospam@gmail.invalid> writes:
>On 14/03/2025 16:44, Tim Rentsch wrote:>
>for( int just_once = 1; just_once; just_once = 0 ){>
Any reason not to say ...
>
do {
...
} while (0);
>
... ?
In fact using do/while(0) is what I first wrote. But then
I thought, oh wait, what if an overzealous compiler gives
a warning because the while() expression is always false? :-/
That would break a lot of macros :)
>[...]>
Hmm, clang with -Weverything is okay with:
do { ... } while (0);
>
But not with:
if ( 0 ) { ... }
>
But it's okay with:
if ( (0) ) { ... }
Les messages affichés proviennent d'usenet.