diff --git a/cmake/traccc-compiler-options-cpp.cmake b/cmake/traccc-compiler-options-cpp.cmake index a99cca82b5..ab188656c1 100644 --- a/cmake/traccc-compiler-options-cpp.cmake +++ b/cmake/traccc-compiler-options-cpp.cmake @@ -23,6 +23,8 @@ if( ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" ) OR traccc_add_flag( CMAKE_CXX_FLAGS "-Wshadow" ) traccc_add_flag( CMAKE_CXX_FLAGS "-Wunused-local-typedefs" ) traccc_add_flag( CMAKE_CXX_FLAGS "-pedantic" ) + traccc_add_flag( CMAKE_CXX_FLAGS "-Wold-style-cast" ) + traccc_add_flag( CMAKE_CXX_FLAGS "-Wnull-dereference" ) if(PROJECT_IS_TOP_LEVEL) traccc_add_flag( CMAKE_CXX_FLAGS "-Wfloat-conversion" ) endif() diff --git a/core/include/traccc/seeding/spacepoint_binning_helper.hpp b/core/include/traccc/seeding/spacepoint_binning_helper.hpp index 56a068d4b3..5a4f2ff2ac 100644 --- a/core/include/traccc/seeding/spacepoint_binning_helper.hpp +++ b/core/include/traccc/seeding/spacepoint_binning_helper.hpp @@ -99,7 +99,8 @@ inline std::pair, detray::axis2::regular<>> get_axes( scalar zBinSize = grid_config.cotThetaMax * grid_config.deltaRMax; detray::dindex zBins = std::max( - 1, (int)std::floor((grid_config.zMax - grid_config.zMin) / zBinSize)); + 1, static_cast( + std::floor((grid_config.zMax - grid_config.zMin) / zBinSize))); detray::axis2::regular m_z_axis{zBins, grid_config.zMin, grid_config.zMax, mr}; diff --git a/extern/tbb/CMakeLists.txt b/extern/tbb/CMakeLists.txt index c6b4d9d0ff..c25bc15c52 100644 --- a/extern/tbb/CMakeLists.txt +++ b/extern/tbb/CMakeLists.txt @@ -29,3 +29,10 @@ set( TBB_STRICT FALSE CACHE BOOL "Do not throw errors on compiler warnings" ) # Get it into the current directory. FetchContent_MakeAvailable( TBB ) + +# Treat the TBB headers as "system headers", to avoid getting warnings from +# them. +get_target_property( _incDirs tbb INTERFACE_INCLUDE_DIRECTORIES ) +target_include_directories( tbb + SYSTEM INTERFACE ${_incDirs} ) +unset( _incDirs ) diff --git a/io/src/csv/read_cells.cpp b/io/src/csv/read_cells.cpp index a80d8f9280..1451202f4c 100644 --- a/io/src/csv/read_cells.cpp +++ b/io/src/csv/read_cells.cpp @@ -58,7 +58,7 @@ traccc::cell_module get_module(const std::uint64_t geometry_id, } // Set the value on the module description. - result.placement = (*geom)[result.surface_link.value()]; + result.placement = geom->at(result.surface_link.value()); } // Find/set the digitization configuration of the detector module. diff --git a/io/src/csv/read_spacepoints.cpp b/io/src/csv/read_spacepoints.cpp index b2a38aba76..41922683b1 100644 --- a/io/src/csv/read_spacepoints.cpp +++ b/io/src/csv/read_spacepoints.cpp @@ -59,7 +59,7 @@ void read_spacepoints(spacepoint_reader_output& out, std::string_view filename, m[iohit.geometry_id] = link; cell_module mod; mod.surface_link = detray::geometry::barcode{iohit.geometry_id}; - mod.placement = geom[iohit.geometry_id]; + mod.placement = geom.at(iohit.geometry_id); result_modules.push_back(mod); }