Deutsch   English   Français   Italiano  
<87v7ykq29y.fsf@nosuchdomain.example.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: how to make a macro work as a single line if stmt without braces
Date: Tue, 24 Sep 2024 12:28:57 -0700
Organization: None to speak of
Lines: 25
Message-ID: <87v7ykq29y.fsf@nosuchdomain.example.com>
References: <PaWdnZ3R-9zI6nP7nZ2dnZfqn_GdnZ2d@brightview.co.uk>
	<vcm16e$1hm2u$1@dont-email.me> <vcn6m8$1n1vu$1@dont-email.me>
	<vcp0rq$26p7b$1@dont-email.me> <20240922080605.59@kylheku.com>
	<vcpeo0$28shf$1@dont-email.me> <20240922192726.000061fc@yahoo.com>
	<86ikul6ruw.fsf@linuxsc.com> <vcujmj$384dh$1@dont-email.me>
	<vcup01$38rb3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 24 Sep 2024 21:28:57 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cfe9758cda96ae01dcefed05ed131451";
	logging-data="3495475"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/ssScTcUFdVU2mpeium2Cs"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:7K9qBtW+VDUEY5qua49fMnAGnR4=
	sha1:Mrlum4f3Ea++jV4lP1gK8nz1hzk=
Bytes: 2023

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.com
void Void(void) { Void(); } /* The recursive call of the void */