Deutsch   English   Français   Italiano  
<86a5gwzmio.fsf@linuxsc.com>

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

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups: comp.lang.c
Subject: Re: on allowing "int a" definition everywhere
Date: Wed, 28 Aug 2024 08:37:35 -0700
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <86a5gwzmio.fsf@linuxsc.com>
References: <afdfe7c37c6ad739fd82c7ec0587b82e0963fce2@i2pn2.org> <va3n09$3nnl8$1@dont-email.me> <f693bfded5f8fec712a445d88ebe34419e0f7072@i2pn2.org> <vajt3u$2so1b$2@dont-email.me> <pan$bb5a3$9945b524$e24df187$e4a83bac@invalid.invalid> <86o75d1ktx.fsf@linuxsc.com> <87ed69crn5.fsf@nosuchdomain.example.com> <87y14gyb5t.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Wed, 28 Aug 2024 17:37:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6b5ad5f5888a1a6f98ce057847c0415f";
	logging-data="3703286"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/pS/ne+rW+rFXCu5Z855L3Cxc36N43pBI="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:34oROGYeIh1liHsb/r7bBFyOHpU=
	sha1:A3fa6KG6GpIJJFd2Q+h/uAh/QLg=
Bytes: 2120

Ben Bacarisse <ben@bsb.me.uk> writes:

> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>
>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>> [...]
>>
>>> Not exactly.  There are things that can be done inside a
>>> statement-expression that are not available inside nested
>>> functions or lambdas.
>>
>> And you're not going to tell us what those things are.
>
> Apparently not.
>
> But one thing occurs to me... you can break (or jump) out of a statement
> expression:
>
>   for (int i = 0; i < 10; i++)
>       printf("%d\n", ({ if (i > 5) break;  i; }));
>
> You can't do this with a lambda or nested function.

Right.  More generally, control transfers to outside the scope of
a statement-expression are allowed.  That includes break, continue,
goto, and importantly return, which returns from the function
containing the statement-expression.