[clang] [C] Add -Wjump-bypasses-init (PR #138009)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon May 5 05:24:35 PDT 2025
AaronBallman wrote:
> this causes a `-Wmicrosoft-goto` warning on
>
> ```
> $ cat /tmp/a.c
> void f() {
> goto l;
> int i = 0;
> l:
> }
> $ bin/clang-cl /c /tmp/a.c
> ...
> /tmp/a.c(2,2): warning: jump from this goto statement to its label is a Microsoft extension [-Wmicrosoft-goto]
> 2 | goto l;
> | ^
> /tmp/a.c(3,6): note: jump bypasses variable initialization
> 3 | int i = 0;
> | ^
> ```
>
> where there was none previously. is this intended?
No, that was not intended; thank you to @zmodem for that fix
https://github.com/llvm/llvm-project/pull/138009
More information about the cfe-commits
mailing list