summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-30 13:55:22 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-30 13:58:37 (GMT)
commita6a04cc446e67017e74e294a4aef84e9e8da4323 (patch)
tree0b7da98857351e8133cc83ff973c443e12b10445 /Source
parent6e8acc51a57e60aff307e4730c8a2314e5cf737a (diff)
parent4fe34b2d29ca67ea91b2545b223dad8abbcad282 (diff)
downloadCMake-a6a04cc446e67017e74e294a4aef84e9e8da4323.zip
CMake-a6a04cc446e67017e74e294a4aef84e9e8da4323.tar.gz
CMake-a6a04cc446e67017e74e294a4aef84e9e8da4323.tar.bz2
Merge topic 'fix-clang-warnings'
4fe34b2d29 Fixing warnings generated by clang 8.0 on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3396
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCallVisualStudioMacro.cxx12
-rw-r--r--Source/cmGlobalGenerator.cxx15
2 files changed, 21 insertions, 6 deletions
diff --git a/Source/cmCallVisualStudioMacro.cxx b/Source/cmCallVisualStudioMacro.cxx
index 2f6cf64..f7a2244 100644
--- a/Source/cmCallVisualStudioMacro.cxx
+++ b/Source/cmCallVisualStudioMacro.cxx
@@ -61,7 +61,8 @@ HRESULT InstanceCallMacro(IDispatch* vsIDE, const std::string& macro,
if (0 != vsIDE) {
DISPID dispid = (DISPID)-1;
- OLECHAR* name = L"ExecuteCommand";
+ wchar_t execute_command[] = L"ExecuteCommand";
+ OLECHAR* name = execute_command;
hr =
vsIDE->GetIDsOfNames(IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
@@ -119,7 +120,8 @@ HRESULT InstanceCallMacro(IDispatch* vsIDE, const std::string& macro,
}
oss << " dwHelpContext: " << excep.dwHelpContext << std::endl;
oss << " pvReserved: " << excep.pvReserved << std::endl;
- oss << " pfnDeferredFillIn: " << excep.pfnDeferredFillIn << std::endl;
+ oss << " pfnDeferredFillIn: "
+ << reinterpret_cast<void*>(excep.pfnDeferredFillIn) << std::endl;
oss << " scode: " << excep.scode << std::endl;
}
@@ -140,7 +142,8 @@ HRESULT GetSolutionObject(IDispatch* vsIDE, IDispatchPtr& vsSolution)
if (0 != vsIDE) {
DISPID dispid = (DISPID)-1;
- OLECHAR* name = L"Solution";
+ wchar_t solution[] = L"Solution";
+ OLECHAR* name = solution;
hr =
vsIDE->GetIDsOfNames(IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
@@ -183,7 +186,8 @@ HRESULT GetSolutionFullName(IDispatch* vsSolution, std::string& fullName)
if (0 != vsSolution) {
DISPID dispid = (DISPID)-1;
- OLECHAR* name = L"FullName";
+ wchar_t full_name[] = L"FullName";
+ OLECHAR* name = full_name;
hr = vsSolution->GetIDsOfNames(IID_NULL, &name, 1, LOCALE_USER_DEFAULT,
&dispid);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 3495f2a..26886f5 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -535,11 +535,22 @@ void cmGlobalGenerator::EnableLanguage(
# ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
# pragma warning(push)
-# pragma warning(disable : 4996)
+# ifdef __INTEL_COMPILER
+# pragma warning(disable : 1478)
+# elif defined __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wdeprecated-declarations"
+# else
+# pragma warning(disable : 4996)
+# endif
# endif
GetVersionExW((OSVERSIONINFOW*)&osviex);
# ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
-# pragma warning(pop)
+# ifdef __clang__
+# pragma clang diagnostic pop
+# else
+# pragma warning(pop)
+# endif
# endif
std::ostringstream windowsVersionString;
windowsVersionString << osviex.dwMajorVersion << "."