Closed Bug 1655132 Opened 4 years ago Closed 4 years ago

warning: comm/mailnews/imap/src/nsImapProtocol.cpp:1829:16 [-Wformat=] format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘nsresult’

Categories

(MailNews Core :: Networking: IMAP, defect)

x86_64
Linux
defect

Tracking

(thunderbird_esr78 wontfix)

RESOLVED FIXED
Thunderbird 80.0
Tracking Status
thunderbird_esr78 --- wontfix

People

(Reporter: aceman, Assigned: aceman)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

I get a few warnings in IMAP code compiling with GCC9.3:
28:29.57 warning: comm/mailnews/imap/src/nsImapProtocol.cpp:1829:16 [-Wformat=] format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘nsresult’
28:29.57 warning: comm/mailnews/imap/src/nsImapProtocol.cpp:4740:14 [-Wformat=] format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘nsresult’
28:29.57 warning: comm/mailnews/imap/src/nsImapProtocol.cpp:4814:35 [-Wformat=] format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘nsresult’

They do not prevent build yet (seems warnings-as-errors is currently disabled), but we should fix this preventively.

I see this also locally.

Regressed by: 1590473
Attached patch 1655132.patchSplinter Review

This is how we print a nsresult, using PRIx32 and static_cast<uint32_t>, as can be seen elsewhere in the file.

Assignee: nobody → acelists
Status: NEW → ASSIGNED
Attachment #9166079 - Flags: review?(mkmelin+mozilla)
Attachment #9166079 - Flags: feedback?(ishikawa)
Comment on attachment 9166079 [details] [diff] [review]
1655132.patch

Review of attachment 9166079 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM, r=mkmelin
Attachment #9166079 - Flags: review?(mkmelin+mozilla) → review+

(In reply to :aceman from comment #2)

Created attachment 9166079 [details] [diff] [review]
1655132.patch

This is how we print a nsresult, using PRIx32 and static_cast<uint32_t>, as can be seen elsewhere in the file.

This is how I would have fixed the formatting issue. (I have fixed the printing of nsresult values using this idiom in my local patches.)

Comment on attachment 9166079 [details] [diff] [review]
1655132.patch

I could compile the C-C TB with aceman's patch (instead of my local patch), too.
I am using GCC-9 under linux.
Attachment #9166079 - Flags: feedback?(ishikawa) → feedback+

Thanks.

Pushed by alessandro@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/ccbde15888d0
printf nsresult using PRIx32 and static_cast in a few places in nsImapProtocol.cpp. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 80.0
Keywords: regression
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: