mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1491849 - Disable C5045 only if optimization is disabled. r=dmajor
I also changed security/certverifier/moz.build a bit while I am here: * Using '-Xclang' to pass through '-Wall' on clang-cl. * Now clang-cl will take clang/gcc path because most '-wd****' options have no effect on clang-cl. '-wd4010' will have an effect, but we already have the corresponding clang/gcc option ('-Wno-unused-parameter'). --HG-- extra : source : df566a1bd9087cc0bfc03fe19fd9d21bf58f5d9c
This commit is contained in:
parent
78e7d3e5c7
commit
cddaaa8ed5
@ -60,13 +60,11 @@ TEST_DIRS += [
|
||||
|
||||
if CONFIG['CC_TYPE'] == 'clang-cl':
|
||||
# -Wall on clang-cl maps to -Weverything, which turns on way too
|
||||
# much, so we're using -W4 instead, which is mapped to clang's
|
||||
# -Wall -Wextra.
|
||||
CXXFLAGS += ['-W4']
|
||||
else:
|
||||
CXXFLAGS += ['-Wall']
|
||||
# much, so we're passing through -Wall using -Xclang.
|
||||
CXXFLAGS += ['-Xclang']
|
||||
CXXFLAGS += ['-Wall']
|
||||
|
||||
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
|
||||
if CONFIG['CC_TYPE'] == 'msvc':
|
||||
# -Wall with Visual C++ enables too many problematic warnings
|
||||
CXXFLAGS += [
|
||||
'-wd4324', # structure was padded due to __declspec(align())
|
||||
@ -98,6 +96,13 @@ if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
|
||||
'-wd4820', # 'bytes' bytes padding added after construct 'member_name'
|
||||
]
|
||||
|
||||
# Disable Spectre diagnostics only if optimization is disabled.
|
||||
if not CONFIG['MOZ_OPTIMIZE']:
|
||||
CXXFLAGS += [
|
||||
'-wd5045', # Compiler will insert Spectre mitigation for memory
|
||||
# load if /Qspectre switch specified
|
||||
]
|
||||
|
||||
# MSVC 2010's headers trigger these
|
||||
CXXFLAGS += [
|
||||
'-wd4548', # expression before comma has no effect; ...
|
||||
@ -129,7 +134,7 @@ if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
|
||||
'-wd4946', # reinterpret_cast used between related types
|
||||
]
|
||||
|
||||
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
|
||||
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
|
||||
CXXFLAGS += [
|
||||
'-Wextra',
|
||||
'-Wunreachable-code',
|
||||
|
@ -70,6 +70,12 @@ elif CONFIG['CC_TYPE'] == 'msvc':
|
||||
# declaration of '*' hides class member
|
||||
'-wd4458',
|
||||
]
|
||||
# Disable Spectre diagnostics only if optimization is disabled.
|
||||
if not CONFIG['MOZ_OPTIMIZE']:
|
||||
CXXFLAGS += [
|
||||
'-wd5045', # Compiler will insert Spectre mitigation for memory load if
|
||||
# /Qspectre switch specified
|
||||
]
|
||||
|
||||
if CONFIG['CC_TYPE'] == 'clang-cl':
|
||||
AllowCompilerWarnings() # workaround for bug 1090497
|
||||
|
Loading…
Reference in New Issue
Block a user