WebKit Bugzilla
Attachment 373138 Details for
Bug 199248
: [MSVC] Catalog warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199248.diff (text/plain), 11.04 KB, created by
Don Olmstead
on 2019-06-28 12:16:15 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Don Olmstead
Created:
2019-06-28 12:16:15 PDT
Size:
11.04 KB
patch
obsolete
>diff --git a/ChangeLog b/ChangeLog >index 51a125bfb09..db17065701e 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,26 @@ >+2019-06-28 Don Olmstead <don.olmstead@sony.com> >+ >+ [MSVC] Catalog warnings >+ https://bugs.webkit.org/show_bug.cgi?id=199248 >+ >+ Reviewed by Brent Fulgham. >+ >+ Catalog all the MSVC warnings providing the message and a link to documentation >+ for the warning. Some warnings are noted as being against the style guide so they >+ won't be addressed. All other warnings could potentially be fixed in the codebase. >+ >+ Additionally the MSVC version is checked to see if it supports a /permissive- >+ mode, which conforms with the standard. The /experiment:external flag is also used >+ which lets a warning level be set for a set of external include directories so a >+ higher warning level can be used for WebKit code. Currently it assumes that any include >+ in angle brackets is external. In this case `/Wall` is used. >+ >+ Currently turning of /WX (Warnings as Errors) for AppleWin until the new warnings with >+ /Wall are either fixed or determined to be benign. >+ >+ * Source/cmake/OptionsAppleWin.cmake: >+ * Source/cmake/OptionsMSVC.cmake: >+ > 2019-06-28 Konstantin Tokarev <annulen@yandex.ru> > > Remove traces of ENABLE_ICONDATABASE remaining after its removal in 219733 >diff --git a/Source/cmake/OptionsAppleWin.cmake b/Source/cmake/OptionsAppleWin.cmake >index df132f9f320..6f248464999 100644 >--- a/Source/cmake/OptionsAppleWin.cmake >+++ b/Source/cmake/OptionsAppleWin.cmake >@@ -71,9 +71,6 @@ else () > WEBKIT_CHECK_HAVE_SYMBOL(HAVE_CACFLAYER_SETCONTENTSSCALE CACFLayerSetContentsScale QuartzCore/CoreAnimationCF.h) > endif () > >-# Warnings as errors (ignore narrowing conversions) >-add_compile_options(/WX /Wv:18) >- > if (INTERNAL_BUILD) > set(WTF_SCRIPTS_DIR "${CMAKE_BINARY_DIR}/../include/private/WTF/Scripts") > set(JavaScriptCore_SCRIPTS_DIR "${CMAKE_BINARY_DIR}/../include/private/JavaScriptCore/Scripts") >diff --git a/Source/cmake/OptionsMSVC.cmake b/Source/cmake/OptionsMSVC.cmake >index df2ffb43f4d..9f4e2c8af9d 100644 >--- a/Source/cmake/OptionsMSVC.cmake >+++ b/Source/cmake/OptionsMSVC.cmake >@@ -1,10 +1,90 @@ >+if (MSVC_VERSION VERSION_LESS 1920 OR COMPILER_IS_CLANG_CL) >+ set(_MSVC_WARNING_LEVEL /W4) >+else () >+ add_compile_options( >+ /permissive- # Full standards conformance >+ /experimental:external # Enable experimental support for "external" headers, See https://devblogs.microsoft.com/cppblog/broken-warnings-theory >+ /external:anglebrackets # Consider #include <> an external header >+ /external:W2 # External header warning level >+ ) >+ set(_MSVC_WARNING_LEVEL /Wall) >+endif () >+message(STATUS "Using warning level ${_MSVC_WARNING_LEVEL}") >+ >+# FIXME: Add warnings as errors /WX >+# List of disabled warnings >+# When adding to the list add a short description and link to the warning's text if available > add_compile_options( >- /wd4018 /wd4068 /wd4099 /wd4100 /wd4127 /wd4138 /wd4146 /wd4180 /wd4189 >- /wd4201 /wd4206 /wd4244 /wd4251 /wd4267 /wd4275 /wd4288 /wd4291 /wd4305 >- /wd4309 /wd4344 /wd4355 /wd4389 /wd4396 /wd4456 /wd4457 /wd4458 /wd4459 >- /wd4481 /wd4503 /wd4505 /wd4510 /wd4512 /wd4530 /wd4610 /wd4611 /wd4646 >- /wd4702 /wd4706 /wd4722 /wd4800 /wd4819 /wd4951 /wd4952 /wd4996 /wd6011 >- /wd6031 /wd6211 /wd6246 /wd6255 /wd6387 >+ /wd4061 # enumerator 'identifier' in switch of enum 'enumeration' is not explicitly handled by a case label >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4061 >+ /wd4103 # 'filename' : alignment changed after including header, may be due to missing #pragma pack(pop) >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4103 >+ /wd4127 # conditional expression is constant >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4127 >+ /wd4146 # unary minus operator applied to unsigned type, result still unsigned >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4146 >+ /wd4191 # 'operator/operation' : unsafe conversion from 'type of expression' to 'type required' >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4191 >+ /wd4201 # nonstandard extension used : nameless struct/union >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4201 >+ /wd4242 # 'identifier' : conversion from 'type1' to 'type2', possible loss of data >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4242 >+ /wd4244 # 'argument' : conversion from 'type1' to 'type2', possible loss of data >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4244 >+ /wd4251 # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4251 >+ /wd4275 # non - DLL-interface class 'class_1' used as base for DLL-interface class 'class_2' >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4275 >+ /wd4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4267 >+ /wd4312 # 'operation' : conversion from 'type1' to 'type2' of greater size >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312 >+ /wd4355 # 'this' : used in base member initializer list >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-c4355 >+ /wd4365 # 'action' : conversion from 'type_1' to 'type_2', signed/unsigned mismatch >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4365 >+ /wd4371 # 'classname': layout of class may have changed from a previous version of the compiler due to better packing of member 'member' >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c4371 >+ /wd4389 # 'operator' : signed/unsigned mismatch >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4389 >+ /wd4456 # declaration of 'identifier' hides previous local declaration >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4456 >+ /wd4457 # declaration of 'identifier' hides function parameter >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4457 >+ /wd4458 # declaration of 'identifier' hides class member >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4458 >+ /wd4459 # declaration of 'identifier' hides global declaration >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4459 >+ /wd4514 # 'function' : unreferenced inline function has been removed >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4514 >+ /wd4577 # 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed >+ /wd4582 # constructor is not implicitly called >+ /wd4583 # destructor is not implicitly called >+ /wd4623 # 'derived class' : default constructor was implicitly defined as deleted because a base class default constructor is inaccessible or deleted >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4623 >+ /wd4625 # 'derived class' : copy constructor was implicitly defined as deleted because a base class copy constructor is inaccessible or deleted >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4625 >+ /wd4626 # 'derived class' : assignment operator was implicitly defined as deleted because a base class assignment operator is inaccessible or deleted >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4626 >+ /wd4646 # function declared with __declspec(noreturn) has non-void return type >+ # https://docs.microsoft.com/mt-mt/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4646 >+ /wd4702 # unreachable code >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4702 >+ /wd4706 # assignment within conditional expression >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4706 >+ # NOTE: Can't fix without changes to style guide >+ /wd4710 # 'function' : function not inlined >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4710 >+ /wd4800 # Implicit conversion from 'type' to bool. Possible information loss >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4800 >+ # NOTE: Can't fix without changes to style guide >+ /wd4820 # 'bytes' bytes padding added after construct 'member_name' >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4820 >+ /wd4946 # reinterpret_cast used between related classes: 'class1' and 'class2' >+ # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4946 >+ /wd5026 # 'type': move constructor was implicitly defined as deleted >+ /wd5027 # 'type': move assignment operator was implicitly defined as deleted >+ /wd5045 # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified > ) > > # Create pdb files for debugging purposes, also for Release builds >@@ -49,10 +129,11 @@ if (NOT ${CMAKE_CXX_FLAGS} STREQUAL "") > string(REGEX REPLACE "(/EH[a-z]+) " "\\1- " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Disable C++ exceptions > string(REGEX REPLACE "/EHsc$" "/EHs- /EHc- " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Disable C++ exceptions > string(REGEX REPLACE "/GR " "/GR- " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Disable RTTI >- # More warnings. /W4 should be specified before -Wno-* options for clang-cl. >+ # FIXME: Can remove replacement of /W3 after CMake 3.15+ is used >+ # More warnings. Warning level should be specified before -Wno-* options for clang-cl. > string(REGEX REPLACE "/W3" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) > string(REGEX REPLACE "/W3" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) >- WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(/W4) >+ WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(${_MSVC_WARNING_LEVEL}) > endif () > > if (MSVC_STATIC_RUNTIME)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199248
:
372974
|
373138
|
419482
|
419488
|
419494
|
419495