Skip to content

Commit

Permalink
build(c): suppress more MSVC warnings (#1674)
Browse files Browse the repository at this point in the history
  • Loading branch information
lidavidm authored Mar 26, 2024
1 parent 1770b0c commit 30c4365
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions c/cmake_modules/AdbcDefines.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion c/driver/framework/base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion c/driver/framework/objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 30c4365

Please sign in to comment.