diff --git a/CHANGELOG.md b/CHANGELOG.md index d0d8f18..e0eac9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file. ### Compilation - Add Compile flag `MSTD_IGNORE_BUGGY_CODE` to ignore any kind of warnings for buggy libraries or headers +- Add exhaustive error flags for compilation ## [0.0.2](https://github.com/97gamjak/mstd/releases/tag/0.0.2) - 2025-11-20 diff --git a/CMakeLists.txt b/CMakeLists.txt index e2478bd..59ab53c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,40 @@ target_compile_features(mstd cxx_std_20 ) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(mstd INTERFACE + -Wall + -Wextra + -Wpedantic + -Werror + + # correctness + -Wshadow + -Wconversion + -Wsign-conversion + -Wcast-align + -Wformat=2 + -Wnull-dereference + -Wdouble-promotion + -Wimplicit-fallthrough + -Woverloaded-virtual + -Wnon-virtual-dtor + -Wold-style-cast + -Wuseless-cast + -Wduplicated-cond + -Wduplicated-branches + -Wlogical-op + -Wmisleading-indentation + + # lifetime / safety + -Wuninitialized + -Wmaybe-uninitialized + -Winit-self + + -Wno-error=deprecated-declarations + ) +endif() + if(MSTD_BUILD_TESTS) include(CTest) enable_testing() diff --git a/include/mstd/pack/integer_pack.hpp b/include/mstd/pack/integer_pack.hpp index be238d8..0dfa0c8 100644 --- a/include/mstd/pack/integer_pack.hpp +++ b/include/mstd/pack/integer_pack.hpp @@ -93,7 +93,7 @@ namespace mstd if (vals[i] != 0) return i; - return -1; + return static_cast(-1); } }; diff --git a/include/mstd/physics/potentials/lie_potential.hpp b/include/mstd/physics/potentials/lie_potential.hpp index ea278eb..0462dff 100644 --- a/include/mstd/physics/potentials/lie_potential.hpp +++ b/include/mstd/physics/potentials/lie_potential.hpp @@ -46,6 +46,8 @@ namespace mstd Rep _coeff2{}; public: + virtual ~LiePotential() = default; + /** * @brief Constructs the potential with prefactors for the attractive * and repulsive terms.