This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/70968] New: Missed case for -Wmisleading-indentation
- From: "segher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 May 2016 22:57:56 +0000
- Subject: [Bug other/70968] New: Missed case for -Wmisleading-indentation
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70968
Bug ID: 70968
Summary: Missed case for -Wmisleading-indentation
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: segher at gcc dot gnu.org
Target Milestone: ---
Compiling the following with current trunk:
===
void g(int);
void f1(int x)
{
if (x) {
g(x--);
} while (x);
}
void f2(int x)
{
if (x)
g(x--);
while (x);
}
void f3(int x)
{
if (x) g(x--); while (x);
}
===
(-Wall -W -O2) only warns for f3. f1 has quite misleading indentation.
A warning for "while (x);" wouldn't hurt either probably, if there is
no whitespace before the semicolon anyway, like in f3.