diff options
author | Peter Wu <peter@lekensteyn.nl> | 2015-02-15 23:22:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-02-20 16:21:43 (GMT) |
commit | e1da4dc2dd55926c9d7140f830a5338512279b3f (patch) | |
tree | d2aebe96f0644c6ac2d60bdb9caa028d2e4bca3b /Modules/CheckStructHasMember.cmake | |
parent | 244867369bcded571a9fe0b06ef2998a5728e368 (diff) | |
download | CMake-e1da4dc2dd55926c9d7140f830a5338512279b3f.zip CMake-e1da4dc2dd55926c9d7140f830a5338512279b3f.tar.gz CMake-e1da4dc2dd55926c9d7140f830a5338512279b3f.tar.bz2 |
CheckStructHasMember: fix null deref warning (#15413)
Clang Static Analyzer is so smart that it reports a defect when this
intended null-deref is encountered. Use sizeof instead which has no
runtime effects.
Diffstat (limited to 'Modules/CheckStructHasMember.cmake')
-rw-r--r-- | Modules/CheckStructHasMember.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake index de31d2c..6c15205 100644 --- a/Modules/CheckStructHasMember.cmake +++ b/Modules/CheckStructHasMember.cmake @@ -69,7 +69,7 @@ macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT) ${_INCLUDE_FILES} int main() { - (void)((${_STRUCT} *)0)->${_MEMBER}; + (void)sizeof(((${_STRUCT} *)0)->${_MEMBER}); return 0; } ") |