-Werror=switch causes TB build failure

RESOLVED FIXED in Thunderbird 36.0

Status

defect
--
blocker
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: jcranmer, Assigned: jcranmer)

Tracking

({dogfood, regression})

Trunk
Thunderbird 36.0
x86_64
Linux
Dependency tree / graph
Bug Flags:
in-testsuite -

Thunderbird Tracking Flags

(thunderbird36 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

5 years ago
tl;dr for anyone not present in the IRC conversation:

Thunderbird adds several nsresult error codes. These aren't in the nsresult enum. We switch on them.
Attachment #8508831 - Flags: review?(nfroyd)
Comment on attachment 8508831 [details] [diff] [review]
Revert -Werror=switch

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

We can argue about this elsewhere (perhaps on dev-platform?), but the status quo is that people make up their own nsresult error codes in Gecko already.  The (admittedly out-of-date!) documentation in nsError.h tells people exactly how to do this, even!  So I think requiring switches on nsresult to adhere to the blessed list of codes in nsErrorList.h is unreasonable.

It'd be an interesting experiment to convert nsresult to a structure type and see if that has adverse effects on performance...
Attachment #8508831 - Flags: review?(nfroyd) → review+
Assignee

Comment 2

5 years ago
https://hg.mozilla.org/mozilla-central/rev/f7ecd7ba118f
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 36.0
Severity: normal → blocker
Keywords: dogfood, regression

Updated

5 years ago
Blocks: 1087098
Depends on: 1090088
nsError.h could be configured so that comm-central uses the `typedef uint32_t nsresult` definition instead of the nsresult enum. Switching on a uint32_t nsresult would no longer generate -Wswitch warnings about out-of-range case values.
Assignee

Updated

4 years ago
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.