Closed Bug 1767114 Opened 2 years ago Closed 2 years ago

Port bug 1766377 - Fix sign-compare warnings on Windows builds

Categories

(Thunderbird :: Upstream Synchronization, task)

Tracking

(thunderbird_esr91 unaffected)

RESOLVED FIXED
102 Branch
Tracking Status
thunderbird_esr91 --- unaffected

People

(Reporter: rjl, Assigned: rachel)

References

Details

Attachments

(2 files, 2 obsolete files)

-Wsign-compare (and -Werror) is now turned on for Windows builds via bug 1762484.

This is a particular gem:

    uint32_t dwordResult = -1;

https://searchfox.org/comm-central/rev/4a1e2097a493783193d61ab1e5dbb8e08d842381/mailnews/import/src/nsWMSettings.cpp#131

Some of these could probably be cast easily enough, but as they say, "here there
be dragons". It's safer to selectively disable the warning-as-error on the
affected files pending closer examination.

Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/6c21051a5d7f
Disable sign-compare warnings on select files. rs=bustage-fix

I had to revert the change on mailnews/mapi/mapiDll/moz.build to get it built locally. Is where a setting to get it working?

I see now that the Windows localised builds have the same issue.

Flags: needinfo?(rob)

Looks like if you're not building with --enable-warnings-as-errors my fix didn't work.

Flags: needinfo?(rob)
Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/c8476a107c16
Follow-up: Fix for builds not using --enable-warnings-as-errors. rs=bustage-fix

Yes, works now. Thanks!

Attached patch 1767114-no-sign-compare.patch (obsolete) — Splinter Review

No dragons.

Attachment #9274601 - Flags: review?(rob)
Attachment #9274601 - Flags: review?(rob) → review+

We can't set "checkin-needed" here.

Flags: needinfo?(rob)

While reviewing, I noticed:

warning: comm/mail/components/search/wsenable/WSEnable.cpp:72:44 [-Wsign-compare] comparison of integers of different signs: 'int' and 'unsigned long long'
warning: comm/mail/components/search/wsenable/WSEnable.cpp:108:46 [-Wsign-compare] comparison of integers of different signs: 'int' and 'unsigned long long'

These don't result in an error because of AllowCompilerWarnings() in the moz.build file.

Flags: needinfo?(rob)

OK, fixed those as well.

Attachment #9274601 - Attachment is obsolete: true
Attachment #9274694 - Flags: review+

Fix-up the moz.build file for WSEnable.exe.

Attachment #9274694 - Attachment is obsolete: true
Attachment #9274697 - Flags: review+
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/f6d775b9b58d
Follow-up: Fix clang-format. rs=clang-format
Assignee: nobody → rachel
Target Milestone: --- → 102 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: