diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index a219be667..66146a119 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -25,12 +25,12 @@ jobs: - name: run cppcheck and check for errors run: | cppcheck --version - cppcheck --force --error-exitcode=1 --language=c++ --std=c++20 --enable=warning,performance,portability --suppress=memleak --check-level=exhaustive . + cppcheck --force --error-exitcode=1 --language=c++ --std=c++20 --enable=warning,performance,portability --suppress=memleak --suppress=passedByValue --check-level=exhaustive . - name: show cppcheck style suggestions run: | cppcheck --version - cppcheck --force --language=c++ --std=c++20 --enable=style --suppress=knownConditionTrueFalse --check-level=exhaustive . + cppcheck --force --language=c++ --std=c++20 --enable=style,performance --suppress=knownConditionTrueFalse --check-level=exhaustive . clang-format: runs-on: ubuntu-24.04 diff --git a/grid.cc b/grid.cc index 2cef7513e..48e5625d8 100644 --- a/grid.cc +++ b/grid.cc @@ -1505,10 +1505,10 @@ auto get_poscoordpointnum(const double pos, const double time, const int axis) - return n_r; } } - assert_always(false); - } else { - assert_always(false); } + + assert_always(false); + return -1; } constexpr auto get_gridcoords_from_xyz(const std::array pos_xyz) -> std::array { diff --git a/sn3d.h b/sn3d.h index d679e82bb..f7c90777f 100644 --- a/sn3d.h +++ b/sn3d.h @@ -99,7 +99,11 @@ inline thread_local auto gslworkspace = #ifdef __NVCOMPILER_CUDA_ARCH__ #define printout(...) printf(__VA_ARGS__) -#define __artis_assert(e) assert(e) +#define __artis_assert(e) \ + { \ + const bool assertpass = static_cast(e); \ + assert(assertpass) \ + } #else inline void print_line_start() {