diff --git a/.github/workflows/gcc.yml b/.github/workflows/gcc.yml index f4ae08f76d..b64dbd3b5f 100644 --- a/.github/workflows/gcc.yml +++ b/.github/workflows/gcc.yml @@ -86,7 +86,7 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build & Install - env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -O1 -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs -Wno-null-dereference"} + env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -O1 -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs"} # It's too slow with -O0 run: | export CCACHE_COMPRESS=1 @@ -353,10 +353,7 @@ jobs: # /home/runner/work/amrex/amrex/Src/Base/AMReX_IntVect.H:194:92: error: array subscript -1 is below array bounds of ‘int [3]’ [-Werror=array-bounds] # int& operator[] (int i) noexcept { BL_ASSERT(i>=0 && i < AMREX_SPACEDIM); return vect[i]; } # - # inlined from ‘const amrex::MultiFab& amrex::EBFArrayBoxFactory::getVolFrac() const’ at /home/runner/work/amrex/amrex/Src/EB/AMReX_EBFabFactory.H:53:91, - # /usr/include/c++/12/bits/shared_ptr_base.h:1666:16: error: potential null pointer dereference [-Werror=null-dereference] - # - env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wunreachable-code -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs -Wno-array-bounds -Wno-null-dereference"} + env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wunreachable-code -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs -Wno-array-bounds"} run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -377,7 +374,6 @@ jobs: -DAMReX_EB=ON \ -DAMReX_ENABLE_TESTS=ON \ -DAMReX_FORTRAN=OFF \ - -DAMReX_FORTRAN=OFF \ -DCMAKE_C_COMPILER=$(which gcc-12) \ -DCMAKE_CXX_COMPILER=$(which g++-12) \ -DCMAKE_CXX_STANDARD=17 \ diff --git a/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H b/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H index e04e16f8bd..f8b09789d4 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H @@ -2009,11 +2009,11 @@ MLCellLinOpT::normInf (int amrlev, MF const& mf, bool local) const -> RT const int finest_level = this->NAMRLevels() - 1; RT norm = RT(0.0); #ifdef AMREX_USE_EB - if (! mf.isAllRegular()) { + const auto *factory = dynamic_cast(this->Factory(amrlev)); + if (factory && !factory->isAllRegular()) { if constexpr (!std::is_same()) { amrex::Abort("MLCellLinOpT with EB only works with MultiFab"); } else { - const auto *factory = dynamic_cast(this->Factory(amrlev)); const MultiFab& vfrac = factory->getVolFrac(); if (amrlev == finest_level) { #ifdef AMREX_USE_GPU