Re: declaration after label

2024-04-03 Thread Bruno Haible
Paul Eggert wrote: > > Did C23 change this or is it just a compiler extension? > > C23 changed this. In C23 you can put a label before a declaration, or > before "}". ... and GCC ≥ 11 allows it also when compiling with -std=gnu99 or -std=gnu11. [1] [1] https://gcc.gnu.org/onlinedocs/gcc-13.2.

Re: declaration after label

2024-04-03 Thread Paul Eggert
On 4/3/24 15:30, Collin Funk wrote: Did C23 change this or is it just a compiler extension? C23 changed this. In C23 you can put a label before a declaration, or before "}".

declaration after label

2024-04-03 Thread Collin Funk
On 4/3/24 2:33 PM, Bruno Haible wrote: > It has a syntax error: With clang and with GCC versions < 11, it is invalid > to put a declaration after a label. See: Good catch. I'm assuming that ISO C doesn't allow declarations after labels, which would explain the null statement (;) fixing it. Did C