[Bug c/107162] New: -Wmisleading-indentation is blinded by comments
kees at outflux dot net
gcc-bugzilla@gcc.gnu.org
Wed Oct 5 18:37:37 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107162
Bug ID: 107162
Summary: -Wmisleading-indentation is blinded by comments
Product: gcc
Version: 12.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: kees at outflux dot net
Target Milestone: ---
Hi,
Similar to this bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106528
-Wmissing-indentation is blinded by comments:
int square(int num) {
if (num == 1)
goto fail;
// if (num == 0)
goto fail;
if (num > 20)
return num * num;
else
return num + num;
fail:
return -1;
}
The above case does not warn in GCC, but does in Clang:
https://godbolt.org/z/bMG5jM9Ga
More information about the Gcc-bugs
mailing list