Bug 1528074 - Translate MSVC warning flags to clang spelling where supported r=froydnj

clang-cl only acts on five MSVC warning flags: 7219c7e9af/clang/include/clang/Driver/CLCompatOptions.td (L188-L197)

With MSVC now unsupported, most -wdNNNN have no effect and can be removed.

This patch converts the five supported warnings to their clang spellings, as preparation for a subsequent patch that will remove all remaining `[/-]w[edo][0-9]{4}`.

Differential Revision: https://phabricator.services.mozilla.com/D22582

--HG--
extra : moz-landing-system : lando
This commit is contained in:
David Major 2019-03-11 01:39:42 +00:00
Родитель 9d0b92de49
Коммит 56ea434680
7 изменённых файлов: 9 добавлений и 14 удалений

Просмотреть файл

@ -28,16 +28,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
'../ffmpeg57/include',
]
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += [ '-Wno-deprecated-declarations' ]
CXXFLAGS += [ '-Wno-deprecated-declarations' ]
if CONFIG['CC_TYPE'] == 'clang':
CXXFLAGS += [
'-Wno-unknown-attributes',
]
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-wd4996', # deprecated declaration
]
DEFINES['FFVPX_VERSION'] = 46465650
DEFINES['USING_MOZFFVPX'] = True

Просмотреть файл

@ -73,7 +73,7 @@ if CONFIG['OS_TARGET'] == 'WINNT':
"avrt",
]
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += ['-wd4005'] # C4005: '_USE_MATH_DEFINES' : macro redefinition
CXXFLAGS += ['-Wno-macro-redefined'] # '_USE_MATH_DEFINES' : macro redefinition
if CONFIG['OS_TARGET'] == 'Android':
SOURCES += ['cubeb_opensl.c']

Просмотреть файл

@ -23,7 +23,7 @@ if CONFIG['CC_TYPE'] == 'clang':
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-wd4018', # signed/unsigned mismatch
'-Wno-sign-compare',
'-wd4146', # unary minus operator applied to unsigned type
'-wd4305', # truncation from 'double' to 'const float'
'-wd4723', # potential divide by 0

Просмотреть файл

@ -173,7 +173,7 @@ elif CONFIG['OS_ARCH'] == 'WINNT':
CXXFLAGS += [
'-wd4275', # non dll-interface class exception used as base for dll-interface class
'-wd4717', # recursive on all control paths, function will cause runtime stack overflow
'-wd4996', # 'GetVersionExW': was declared deprecated
'-Wno-deprecated-declarations', # 'GetVersionExW': was declared deprecated
'-wd4302', # 'reinterpret_cast': truncation from 'LPCSTR' to 'WORD'
'-wd4311', # 'reinterpret_cast': pointer truncation from 'LPOVERLAPPED' to 'DWORD'
'-wd4312', # 'reinterpret_cast': conversion from 'DWORD' to 'LPOVERLAPPED' of greater size

Просмотреть файл

@ -21,7 +21,7 @@ if CONFIG['CC_TYPE'] == 'clang-cl':
'-Xclang',
'-fcxx-exceptions',
]
elif CONFIG['CC_TYPE'] != 'clang-cl':
else:
CXXFLAGS += [
'-fexceptions',
]
@ -34,7 +34,7 @@ Library('jsoncpp')
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-wd4005', # macro redefinition
'-Wno-macro-redefined',
]
elif CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += [

Просмотреть файл

@ -138,8 +138,8 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
]
elif CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-wd4005', # 'WIN32_LEAN_AND_MEAN' : macro redefinition
'-wd4018', # '<' : signed/unsigned mismatch
'-Wno-macro-redefined', # 'WIN32_LEAN_AND_MEAN' : macro redefinition
'-Wno-sign-compare',
'-wd4065', # switch statement contains 'default' but no 'case' labels
'-wd4099', # mismatched class/struct tags
'-wd4305', # double to float truncation

Просмотреть файл

@ -12,7 +12,7 @@ LOCAL_INCLUDES += [
# Suppress warnings in third-party code.
if CONFIG['CC_TYPE'] == 'clang-cl':
CXXFLAGS += [
'-wd4005', # macro redefinition
'-Wno-macro-redefined',
'-wd4146', # negative unsigned
'-wd4334', # 32-bit shift to 64 bits
'-wd4804', # unsafe use of type 'bool'