This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 30c436571 build(c): suppress more MSVC warnings (#1674)
30c436571 is described below
commit 30c436571f208068f26475063b53ed9d77719f58
Author: David Li <[email protected]>
AuthorDate: Tue Mar 26 13:59:25 2024 -0400
build(c): suppress more MSVC warnings (#1674)
---
c/cmake_modules/AdbcDefines.cmake | 6 ++++++
c/driver/framework/base.cc | 2 +-
c/driver/framework/objects.cc | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/c/cmake_modules/AdbcDefines.cmake
b/c/cmake_modules/AdbcDefines.cmake
index 2cf5e2ffa..c0bf38a41 100644
--- a/c/cmake_modules/AdbcDefines.cmake
+++ b/c/cmake_modules/AdbcDefines.cmake
@@ -77,6 +77,11 @@ if(MSVC)
# Allow incomplete switch (since MSVC warns even if there's a default case)
add_compile_options(/wd4061)
add_compile_options(/wd4100)
+ # Nanoarrow emits a lot of conversion warnings
+ add_compile_options(/wd4365)
+ add_compile_options(/wd4458)
+ add_compile_options(/wd4514)
+ add_compile_options(/wd4582)
add_compile_options(/wd4623)
add_compile_options(/wd4625)
add_compile_options(/wd4626)
@@ -85,6 +90,7 @@ if(MSVC)
add_compile_options(/wd4711)
# Don't warn about padding added after members
add_compile_options(/wd4820)
+ add_compile_options(/wd5027)
add_compile_options(/wd5045)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"
OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
diff --git a/c/driver/framework/base.cc b/c/driver/framework/base.cc
index ab94caf37..2e93b8f61 100644
--- a/c/driver/framework/base.cc
+++ b/c/driver/framework/base.cc
@@ -147,7 +147,7 @@ AdbcStatusCode Option::CGet(double* out, AdbcError* error)
const {
[&](auto&& value) -> AdbcStatusCode {
using T = std::decay_t<decltype(value)>;
if constexpr (std::is_same_v<T, double> || std::is_same_v<T, int64_t>)
{
- *out = value;
+ *out = static_cast<double>(value);
return ADBC_STATUS_OK;
} else if constexpr (std::is_same_v<T, Unset>) {
return status::NotFound("Unknown option").ToAdbc(error);
diff --git a/c/driver/framework/objects.cc b/c/driver/framework/objects.cc
index 28e33c0c1..67f5b26f0 100644
--- a/c/driver/framework/objects.cc
+++ b/c/driver/framework/objects.cc
@@ -69,7 +69,7 @@ struct GetObjectsBuilder {
table_types(table_types),
schema(schema),
array(array) {
- na_error = {0};
+ std::memset(&na_error, 0, sizeof(na_error));
}
Status Build() {