Skip to content
Snippets Groups Projects
Forked from ogs / ogs
Source project has a limited visibility.
  • Dmitri Naumov's avatar
    53321f24
    [PL] Revert ranges to for-range loop · 53321f24
    Dmitri Naumov authored
    Unfortunately with gcc-13.2.1 with optimizations there is a warning, which I was not able to correct.
    
        ...
        inlined from ‘std::vector<std::tuple<long int, std::reference_wrapper<ProcessLib::LocalAssemblerInterface> > > {anonymous}::collectActiveLocalAssemblers(const BaseLib::PolymorphicRandomAccessContainerView<ProcessLib::LocalAssemblerInterface>&, const std::vector<long unsigned int>&)’ at /var/lib/gitlab-runner/builds/F1XUyv4cx/1/ogs/ogs/ProcessLib/Assembly/ParallelVectorMatrixAssembler.cpp:132:62:
    /usr/include/c++/13.2.1/bits/stl_iterator_base_funcs.h:175:9: warning: iteration 576460752303423487 invokes undefined behavior [-Waggressive-loop-optimizations]
      175 |         while (__n--)
          |         ^~~~~
    /usr/include/c++/13.2.1/bits/stl_iterator_base_funcs.h:175:9: note: within this loop
    
    Other compilers gcc-14, clang-17 and 18, msvc had no problems with the
    former code.
    53321f24
    History
    [PL] Revert ranges to for-range loop
    Dmitri Naumov authored
    Unfortunately with gcc-13.2.1 with optimizations there is a warning, which I was not able to correct.
    
        ...
        inlined from ‘std::vector<std::tuple<long int, std::reference_wrapper<ProcessLib::LocalAssemblerInterface> > > {anonymous}::collectActiveLocalAssemblers(const BaseLib::PolymorphicRandomAccessContainerView<ProcessLib::LocalAssemblerInterface>&, const std::vector<long unsigned int>&)’ at /var/lib/gitlab-runner/builds/F1XUyv4cx/1/ogs/ogs/ProcessLib/Assembly/ParallelVectorMatrixAssembler.cpp:132:62:
    /usr/include/c++/13.2.1/bits/stl_iterator_base_funcs.h:175:9: warning: iteration 576460752303423487 invokes undefined behavior [-Waggressive-loop-optimizations]
      175 |         while (__n--)
          |         ^~~~~
    /usr/include/c++/13.2.1/bits/stl_iterator_base_funcs.h:175:9: note: within this loop
    
    Other compilers gcc-14, clang-17 and 18, msvc had no problems with the
    former code.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.