goto skipping declarations

Derek Fawcus dfawcus+dlang at employees.org
Fri Sep 19 17:46:22 UTC 2025


On Friday, 19 September 2025 at 02:03:57 UTC, Steven 
Schveighoffer wrote:
> On Friday, 19 September 2025 at 00:02:53 UTC, Walter Bright 
> wrote:
>> gcc does not produce an error:


Yup, and has done for a while - one just needs to enable the 
errors (it is a bit sad that '-Wall' stopped having things added, 
so creating '-Wextra'):

```
$ gcc-11 -Wall -Wextra -Werror -c skip.c
skip.c: In function ‘foo’:
skip.c:1:13: error: unused parameter ‘x’ 
[-Werror=unused-parameter]
     1 | int foo(int x) {
       |         ~~~~^
skip.c:5:14: error: ‘what’ is used uninitialized 
[-Werror=uninitialized]
     5 |       return what;
       |              ^~~~
cc1: all warnings being treated as errors
```

The complaint about 'what' happens with '-Wall' alone. If one 
used gcc-12 and later, it also states where 'what' is declared.


More information about the Digitalmars-d mailing list