Disable Clang's warnings about undefined pointer comparisons in Debug builds

The address of a reference, or the 'this' pointer, are always non-NULL
in well-defined C/C++ programs, and Clang warns about comparing them to NULL,
because the comparisons may be optimized away.

However, it can still be useful to do such comparisons in Debug builds.
For example, Skia does a lot of SkASSERT(&a), where a is a reference
parameter.

BUG=404271

Review URL: https://codereview.chromium.org/479293002

git-svn-id: http://src.chromium.org/svn/trunk/src/build@290361 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
hans@chromium.org 2014-08-18 21:01:08 +00:00
Родитель b93987c78b
Коммит 67dd702733
1 изменённых файлов: 24 добавлений и 0 удалений

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

@ -3231,6 +3231,30 @@
],
},
}],
['clang==1', {
'cflags': [
# Allow comparing the address of references and 'this' against 0
# in debug builds. Technically, these can never be null in
# well-defined C/C++ and Clang can optimize such checks away in
# release builds, but they may be used in asserts in debug builds.
'-Wno-undefined-bool-conversion',
'-Wno-tautological-undefined-compare',
],
'xcode_settings': {
'OTHER_CFLAGS': [
'-Wno-undefined-bool-conversion',
'-Wno-tautological-undefined-compare',
],
},
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
'-Wno-undefined-bool-conversion',
'-Wno-tautological-undefined-compare',
],
},
},
}],
],
},
'Release_Base': {