Closed Bug 1521694 Opened 5 years ago Closed 5 years ago

clang build warning: widget/windows/nsWindow.cpp(4688,13): warning: enumeration value 'nsSizeMode_Invalid' not handled in switch [-Wswitch]

Categories

(Core :: Widget: Win32, enhancement)

65 Branch
All
Windows
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

Details

Attachments

(1 file)

0:17.89 In file included from m:/fx64-dbg/widget/windows/Unified_cpp_widget_windows2.cpp:110:
0:17.89 m:/src/widget/windows/nsWindow.cpp(4688,13): warning: enumeration value 'nsSizeMode_Invalid' not handled in switch [-Wswitch
0:17.89 switch (sizeMode) {
0:17.89 ^

DisplaySystemMenu() does not handle nsSizeMode_Invalid that causes warning of
clang. This patch makes it treat nsSizeMode_Invalid. When it receives the
value, it will call NS_ASSERTION() to be detectable on debug builds during
automated tests.

Additionally, this adds default case into the switch statement with
MOZ_ASSERT_UNREACHABLE(). Then, when somebody adds new nsSizeMode, they
can detect it with crash in debug build if they forget to change this method.

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/3883a443b7f8
Make DisplaySystemMenu() handle all nsSizeMode value r=jmathies
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: