Skip to content

Commit

Permalink
Enable -Werror for release gcc/clang builds
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Glustein <[email protected]>
  • Loading branch information
AdamGlustein committed Jul 12, 2024
1 parent 4eb82ae commit 50727ea
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ else()
-O3 \
-g0 \
-Wall \
-Werror \
-Wno-deprecated-declarations \
-Wno-deprecated \
")
Expand Down
3 changes: 2 additions & 1 deletion cpp/csp/adapters/parquet/ParquetOutputAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ template< typename A, typename V = typename A::value_type >
inline std::shared_ptr<::arrow::ArrayBuilder> makeArrayAndAttachToWriter( DialectGenericListWriterInterface::Ptr &listWriterInterface )
{
auto&& typedWriter = std::dynamic_pointer_cast<TypedDialectGenericListWriterInterface<V>>( listWriterInterface );
auto& listWriterInterfaceRef = *listWriterInterface;
CSP_TRUE_OR_THROW( typedWriter != nullptr, TypeError,
"Expected " << typeid( TypedDialectGenericListWriterInterface<V> ).name() << " " << " got " <<
typeid( *listWriterInterface ).name() );
typeid( listWriterInterfaceRef ).name() );

auto res = std::make_shared<A>();
typedWriter -> setWriteFunction(
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/python/PyStructToJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ inline rapidjson::Value toJson( const TimeDelta& val, const CspType& typ, rapidj
// Convert TimeDelta to <sign><seconds>.<microseconds>
// sign( 1 ) + seconds ( 18 ) + '.'( 1 ) + microseconds( 9 ) + '\0'( 1 )
char buf[32] = {};
auto seconds = val.abs().asSeconds();
long seconds = val.abs().asSeconds();
auto microseconds = static_cast<unsigned>( val.abs().nanoseconds() / NANOS_PER_MICROSECOND );
auto len = sprintf( buf, "%c%ld.%06u", ( val.sign() >= 0 ) ? '+' : '-', seconds, microseconds );
rapidjson::Value res;
Expand Down
4 changes: 4 additions & 0 deletions cpp/csp/python/adapters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ if(CSP_BUILD_PARQUET_ADAPTER)
${VENDORED_PYARROW_ROOT}/arrow/python/csv.cc
${VENDORED_PYARROW_ROOT}/arrow/python/filesystem.cc)
add_library(parquetadapterimpl SHARED parquetadapterimpl.cpp ${ARROW_PYTHON_SRCS})
# Ignore warning regarding static datetime API initialization coming from vendored Arrow code
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(parquetadapterimpl PROPERTIES COMPILE_OPTIONS "-Wno-unused-variable")
endif()
target_link_libraries(parquetadapterimpl csp_core csp_engine cspimpl csp_parquet_adapter)
target_include_directories(parquetadapterimpl PUBLIC ${ARROW_INCLUDE_DIR} ${PARQUET_INCLUDE_DIR} "${VENDORED_PYARROW_ROOT}")
target_compile_definitions(parquetadapterimpl PUBLIC ARROW_PYTHON_STATIC)
Expand Down
10 changes: 10 additions & 0 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
add_subdirectory(core)
add_subdirectory(engine)

# Ignore bogus gcc warning which is coming from gtest headers
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651
set(SUBDIRS core engine)
foreach(SUBDIR ${SUBDIRS})
get_directory_property(SUBDIR_TARGETS DIRECTORY ${SUBDIR} BUILDSYSTEM_TARGETS)
foreach(TARGET ${SUBDIR_TARGETS})
set_target_properties(${TARGET} PROPERTIES COMPILE_OPTIONS "-Wno-restrict")
endforeach()
endforeach()

0 comments on commit 50727ea

Please sign in to comment.