Sujet : Re: how to make a macro work as a single line if stmt without braces
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 24. Sep 2024, 20:28:57
Autres entêtes
Organisation : None to speak of
Message-ID : <87v7ykq29y.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Gnus/5.13 (Gnus v5.13)
Bart <
bc@freeuk.com> writes:
On 24/09/2024 15:52, Andrey Tarasevich wrote:
[...]
The same applies to
if(x)
bar(x);
This is the right thing to do. It is the most readable and elegant
way to write a simple `if`.
>
Well, it is the ONLY way C provides to write the branches of an
if-statement. Each only takes a single statement.
You misunderstood. Andrey was saying that
if(x)
bar(x);
is right and
if(x) bar(x);
is wrong. Of course both are legal; Andrey is arguing that nobody
should ever use the second form.
[...]
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */