diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-10-30 17:49:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-10-30 18:16:06 (GMT) |
commit | 8d6ba35827bc4025a39acace8b65f2de96613a8a (patch) | |
tree | 34c4c4b90a67395ec28f6442e5d3ecf06266c6a5 /Modules/CheckStructHasMember.cmake | |
parent | 384d3ce7204f5a93833494db7808c1f0359db5ba (diff) | |
download | CMake-8d6ba35827bc4025a39acace8b65f2de96613a8a.zip CMake-8d6ba35827bc4025a39acace8b65f2de96613a8a.tar.gz CMake-8d6ba35827bc4025a39acace8b65f2de96613a8a.tar.bz2 |
CheckStructHasMember: Avoid clang -Wall breakage (#15203)
With CMAKE_C_COMPILER=clang and CMAKE_C_FLAGS='-Wall -Werror', this test
breaks with -Werror,-Wuninitialized. Fix this by getting rid of the
temporary variable.
Diffstat (limited to 'Modules/CheckStructHasMember.cmake')
-rw-r--r-- | Modules/CheckStructHasMember.cmake | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake index c8949cf..de31d2c 100644 --- a/Modules/CheckStructHasMember.cmake +++ b/Modules/CheckStructHasMember.cmake @@ -69,8 +69,7 @@ macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT) ${_INCLUDE_FILES} int main() { - ${_STRUCT}* tmp; - (void) tmp->${_MEMBER}; + (void)((${_STRUCT} *)0)->${_MEMBER}; return 0; } ") |