[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sv: Is this a bug in while-let or do I missunderstand it?
From: |
tomas |
Subject: |
Re: Sv: Is this a bug in while-let or do I missunderstand it? |
Date: |
Mon, 11 Nov 2024 13:23:43 +0100 |
On Mon, Nov 11, 2024 at 08:49:39AM +0000, arthur miller wrote:
[...]
> Actually didn't know we can introduce new variable in while declaration in
> C++; in C it is verbotten:
>
> ~/repos/test $ gcc -o test test.c
> test.c: In function 'main':
> test.c:3:10: error: expected expression before 'int'
> 3 | while (int i = 0) {
> | ^~~
> test.c:4:5: error: 'i' undeclared (first use in this function)
> 4 | i++;
> | ^
> test.c:4:5: note: each undeclared identifier is reported only once for each
> function it appears in
AFAIK, it is erlaubt since C99.
Cheers
--
t
signature.asc
Description: PGP signature
- RE: [External] : Re: Is this a bug in while-let or do I missunderstand it?, (continued)
- RE: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Drew Adams, 2024/11/09
- Re: Is this a bug in while-let or do I missunderstand it?, John ff, 2024/11/14
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/10
- Re: Is this a bug in while-let or do I missunderstand it?, Eli Zaretskii, 2024/11/10
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/10
- Re: Is this a bug in while-let or do I missunderstand it?, Alfred M. Szmidt, 2024/11/10
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/10
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/10
- Re: Is this a bug in while-let or do I missunderstand it?, Yuri Khan, 2024/11/11
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/11
- Re: Sv: Is this a bug in while-let or do I missunderstand it?,
tomas <=
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/11
- Re: Is this a bug in while-let or do I missunderstand it?, Eli Zaretskii, 2024/11/12
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/12
- Re: Is this a bug in while-let or do I missunderstand it?, Eli Zaretskii, 2024/11/12
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/12
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/12
- Re: Is this a bug in while-let or do I missunderstand it?, Sean Whitton, 2024/11/13
- Re: Is this a bug in while-let or do I missunderstand it?, Sean Whitton, 2024/11/13
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/13
- Re: Is this a bug in while-let or do I missunderstand it?, Sean Whitton, 2024/11/13