Closed Bug 1497221 Opened 3 years ago Closed 3 years ago

nsNativeThemeWin.cpp puts a lot of warnings when build with clang

Categories

(Core :: Widget: Win32, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

Details

Attachments

(1 file)

I see the following warnings when I compile nsNativeThemeWin.cpp with clang.

> 10:12.54 In file included from c:/mozilla/fx64-dbg/widget/windows/Unified_cpp_widget_windows2.cpp:38:
> 10:12.58 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(692,11):  warning: 126 enumeration values not handled in switch: 'None', 'Button', 'ButtonArrowDown'
> ... [-Wswitch]
> 10:12.58   switch (aWidgetType) {
> 10:12.58           ^
> 10:12.58 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(726,11):  warning: 50 enumeration values not handled in switch: 'None', 'ButtonArrowDown', 'ButtonAr
> rowNext'... [-Wswitch]
> 10:12.58   switch (aWidgetType) {
> 10:12.59           ^
> 10:12.59 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(885,11):  warning: 54 enumeration values not handled in switch: 'None', 'ButtonArrowDown', 'ButtonAr
> rowNext'... [-Wswitch]
> 10:12.59   switch (aWidgetType) {
> 10:12.59           ^
> 10:12.60 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(1587,13):  warning: 118 enumeration values not handled in switch: 'None', 'Button', 'ButtonArrowDown
> '... [-Wswitch]
> 10:12.60     switch (aWidgetType) {
> 10:12.60             ^
> 10:12.76 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(2136,11):  warning: 129 enumeration values not handled in switch: 'None', 'Button', 'ButtonArrowDown
> '... [-Wswitch]
> 10:12.80   switch (aWidgetType) {
> 10:12.83           ^
> 10:12.90 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(2362,11):  warning: 113 enumeration values not handled in switch: 'None', 'Button', 'ButtonArrowDown
> '... [-Wswitch]
> 10:12.92   switch (aWidgetType) {
> 10:12.94           ^
> 10:12.98 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(2391,11):  warning: 93 enumeration values not handled in switch: 'None', 'ButtonArrowDown', 'ButtonA
> rrowNext'... [-Wswitch]
> 10:13.05   switch (aWidgetType) {
> 10:13.09           ^
> 10:13.16 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(2762,11):  warning: 118 enumeration values not handled in switch: 'None', 'Button', 'ButtonArrowDown
> '... [-Wswitch]
> 10:13.24   switch (aWidgetType) {
> 10:13.31           ^
> 10:13.36 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(2816,11):  warning: 66 enumeration values not handled in switch: 'None', 'ButtonArrowDown', 'ButtonA
> rrowNext'... [-Wswitch]
> 10:13.40   switch (aWidgetType) {
> 10:13.43           ^
> 10:13.47 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(3427,15):  warning: 127 enumeration values not handled in switch: 'None', 'Button', 'ButtonArrowDown
> '... [-Wswitch]
> 10:13.50       switch (aWidgetType) {
> 10:13.53               ^
> 10:13.62 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(3457,15):  warning: 128 enumeration values not handled in switch: 'None', 'Button', 'ButtonArrowDown
> '... [-Wswitch]
> 10:13.70       switch (aWidgetType) {
> 10:13.79               ^
> 10:13.82 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(3213,11):  warning: 69 enumeration values not handled in switch: 'None', 'ButtonArrowDown', 'ButtonA
> rrowNext'... [-Wswitch]
> 10:13.89   switch (aWidgetType) {
> 10:14.13           ^
> 10:14.19 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(4142,11):  warning: 79 enumeration values not handled in switch: 'None', 'ButtonArrowDown', 'ButtonA
> rrowNext'... [-Wswitch]
> 10:14.25   switch (aWidgetType) {
> 10:14.29           ^
> 10:18.34 In file included from c:/mozilla/fx64-dbg/widget/windows/Unified_cpp_widget_windows2.cpp:38:
> 10:18.37 c:/mozilla/src/widget/windows/nsNativeThemeWin.cpp(2026,1):  warning: unused function 'ScaleForFrameDPI' [-Wunused-function]
> 10:18.42 ScaleForFrameDPI(nsIntMargin* aMargin, nsIFrame* aFrame)

This too many warnings hide preceding warnings and errors at building my patch.
nsNativeThemeWin.cpp has a lot of warnings at build time.  They hides preceding
errors and warning due to too many.  This patch avoids the warnings with:

- adding |default| case of each |switch| statement with widget type.
- removing unused overload of ScaleForFrameDPI().
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/b85ace8c5339
Fix warnings in nsNativeThemeWin.cpp when built with clang r=jmathies
https://hg.mozilla.org/mozilla-central/rev/b85ace8c5339
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.