Sujet : Re: "A diagram of C23 basic types"
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.cDate : 03. Apr 2025, 10:03:02
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vslis6$8mfb$2@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 02/04/2025 23:43, Janis Papanagnou wrote:
On 02.04.2025 16:59, David Brown wrote:
[...]
>
From the next version beyond C23, so far there is :
>
1. Declarations in "if" and "switch" statements, like those in "for"
loops, helps keep local variable scopes small and neat.
Oh, I thought that would already be supported in some existing "C"
version for the 'if'; I probably confused that with C++.
C++17 has it.
I guess the C committee waited until C++17 had been common enough that they could see if it was useful in real code, and if it lead to any unexpected problems in code or compilers before copying it for C.