summaryrefslogtreecommitdiffstats
path: root/Modules/CheckStructHasMember.cmake
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-10-30 17:49:09 (GMT)
committerBrad King <brad.king@kitware.com>2014-10-30 18:16:06 (GMT)
commit8d6ba35827bc4025a39acace8b65f2de96613a8a (patch)
tree34c4c4b90a67395ec28f6442e5d3ecf06266c6a5 /Modules/CheckStructHasMember.cmake
parent384d3ce7204f5a93833494db7808c1f0359db5ba (diff)
downloadCMake-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.cmake3
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;
}
")