mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-06 04:03:27 +03:00
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.
This commit is contained in:
1 parent
384d3ce720
commit
8d6ba35827
1 file changed
+1
-2
@@ -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;
|
||||
}
|
||||
")
|
||||
|
||||
Reference in new issue
Block a user