From 96f59dcbae5910dd7d3cb10ac8c05b13cb98a24b Mon Sep 17 00:00:00 2001 From: Tobias Hienzsch Date: Tue, 17 Sep 2024 10:44:59 +0200 Subject: [PATCH] [cpp] Add compiler warning flags --- src/cpp/CMakeLists.txt | 4 ++-- src/cpp/pffdtd/hdf.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index 797ac88..d87820d 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -40,7 +40,7 @@ if(PFFDTD_HAS_SYCL) endif() if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")) - target_compile_options(pffdtd PRIVATE /W3) + target_compile_options(pffdtd PUBLIC /W3) else () - target_compile_options(pffdtd PRIVATE -Wno-deprecated-declarations) + target_compile_options(pffdtd PUBLIC -Wall -Wextra -Wno-deprecated-declarations) endif () diff --git a/src/cpp/pffdtd/hdf.hpp b/src/cpp/pffdtd/hdf.hpp index dcb1258..7c699b6 100644 --- a/src/cpp/pffdtd/hdf.hpp +++ b/src/cpp/pffdtd/hdf.hpp @@ -70,7 +70,7 @@ struct H5FReader { auto set = H5Dopen(_handle, dataset, H5P_DEFAULT); auto space = H5Dget_space(set); - auto ndims = 1UL; + auto ndims = 1; auto dims = std::array{}; PFFDTD_ASSERT(H5Sget_simple_extent_ndims(space) == ndims); H5Sget_simple_extent_dims(space, dims.data(), NULL);