Closed Bug 1762484 Opened 2 years ago Closed 2 years ago

Enable on Windows the same warnings as on other platforms

Categories

(Firefox Build System :: General, enhancement)

Desktop
Windows
enhancement

Tracking

(firefox101 fixed)

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: bryce, Assigned: glandium)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Clang's thread-safety annotations do not appear to trigger warnings on Windows when they do on other platforms. I've attached a small patch that shows changes that should create such a violation.

Changing my mozconfig to include the additional lines

export CFLAGS="-Wthread-safety -Werror=thread-safety"
export CXXFLAGS="-Wthread-safety -Werror=thread-safety"

results in the expected warnings.

I've also tried changing this line to

when=depends(c_compiler)(lambda c: c.type in ["clang", "clang-cl"] and c.version >= "8.0"),

with no mozconfig changes and I don't see any warnings. I've also tried removing the condition and just setting

check_and_add_gcc_warning("-Wthread-safety")

and that also did not produce warnings.

There are historic reasons we use different warning flags on Windows (hint: MSVC), but they don't apply anymore. I actually have some work in progress to enable everything that is enabled on other platforms on Windows.

Assignee: nobody → mh+mozilla
Component: Source Code Analysis → General
Summary: Thread-safety analysis is not checked on Windows → Enable on Windows the same warnings as on other platforms
No longer blocks: 1762490
Depends on: 1762490
Type: defect → enhancement

I'm attempting to land bug 1762839 now, and hope bug 1762490 can be landed soon(ish). Those are the only remaining blockers for me to get a local build happy.

This allows to remove the requirement on "--help" for dependable(),
which avoids dependable() implying the execution of when when it's
within a with only_when.

This is in preparation for those functions taking care of all platforms
and compilers.

This moves the manual addition of some flags from old-configure to
python configure, and disables the set of flags that still trigger a
bunch of warnings (which -Werror turns into bustage).

The attached patches enable everything but:

  • -Wcomma
  • -Wunreachable-code-return
  • -Wunreachable-code
  • -Wignored-qualifiers
  • -Wbitfield-enum-conversion
  • -Wclass-varargs
  • -Wimplicit-fallthrough
  • -Wsign-compare
  • -Wthread-safety

I have patches for most of them, except -Wthread-safety. I will file separate bugs for each of those next week.

Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/53c3a90bae93
Allow plain values instead of functions for depends()(). r=firefox-build-system-reviewers,mhentges
https://hg.mozilla.org/integration/autoland/rev/d2355490a174
Remove `gcc` from warning and flag function names. r=firefox-build-system-reviewers,mhentges
https://hg.mozilla.org/integration/autoland/rev/e4effc1c1878
Enable most of the same warnings on Windows as on other platforms. r=firefox-build-system-reviewers,andi
Blocks: 1766347
Blocks: 1766359
Blocks: 1766364
Blocks: 1766368
Blocks: 1766370
Blocks: 1766371
Blocks: 1766375
Blocks: 1766377
Blocks: 1766378
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/bdcda82fcfab
adjust comm-central for "Enable on Windows the same warnings as on other platforms". rs=bustage-fix
See Also: → 1767114
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: