I think this is the same bug already filed here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70954 Martin Am Mittwoch, dem 01.11.2023 um 09:11 +0100 schrieb Rene Kita: > Since I'm unable to create an account to report a bug and got no reply > from gcc-bugzilla-account-requ...@gcc.gnu.org I'll dump this here. > > Depending on the placement of a label Gcc gives a false positive warning > about misleading indentation. Below is a minimal working example to > reproduce and the output from Gcc. > > Arsen Arsenović was so kind to confirm (on IRC) this bug is reproducible > with a current Gcc and asked me to report it. > > /* > * miside.c > * MWE for a wrong warning shown with gcc -Wmisleading-indentation > */ > > void > good(int c) > { > label: > while (c != '-'); > if (c != '-') > goto label; > } > > void > bad(int c) > { > label: while (c != '-'); > if (c != '-') > goto label; > } > > /* > % gcc -c -Wmisleading-indentation miside.c > miside.c: In function ‘bad’: > miside.c:18:9: warning: this ‘while’ clause does not guard... > [-Wmisleading-indentation] > 18 | label: while (c != '-'); > | ^~~~~ > miside.c:19:9: note: ...this statement, but the latter is misleadingly > indented as if it were guarded by the ‘while’ > 19 | if (c != '-') > | ^~ > */