Closed Bug 1297639 Opened 8 years ago Closed 6 years ago

Make -Wmisleading-indentation a fatal error

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla61

People

(Reporter: nical, Unassigned)

References

Details

This type of code:

> if (cond)
>   foo();
>   return;

Is very bad, and is caught by gcc as a warning, at least in the version of gcc installed by default in the current fedora, with the -Wmisleading-indentation warning.

We should not let this type of thing land. I hope that which ever version of the compiler we use on try has the same warning so that we can turn it into an error.
The warning was introduced with gcc6 and there's clang bug open here https://llvm.org/bugs/show_bug.cgi?id=23910 so it looks like clang does not have it yet.
and we're not building with gcc 6.
Depends on: 1297661
Depends on: 1297662
Depends on: 1297659, 1297655, 1297649, 1297647, 1297644
No longer depends on: 1297661, 1297662
Depends on: 1297661, 1297662
Depends on: 1299234
Product: Core → Firefox Build System
We are now using gcc 6.1 and -Wmisleading-indentation is enabled by -Wall. clang doesn't support the -Wmisleading-indentation flag, but clang-tidy does a similar indentation check:

https://clang.llvm.org/extra/clang-tidy/checks/readability-misleading-indentation.html
Status: NEW → RESOLVED
Closed: 6 years ago
Depends on: gcc-6.1
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Which is enabled at dev / review phease:
https://dxr.mozilla.org/mozilla-central/source/tools/clang-tidy/config.yaml#76
You need to log in before you can comment on or make changes to this bug.