[Bug c/106569] enhancement: use STL algorithm instead of a raw loop

2022-08-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106569 --- Comment #8 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #5) > (In reply to David Binderman from comment #0) > > Static analyser cppcheck can produce these style messages for gcc trunk > > source code: > > > > $ fgrep u

[Bug c/106569] enhancement: use STL algorithm instead of a raw loop

2022-08-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106569 --- Comment #7 from Jonathan Wakely --- std::find_if exists since c++98. I'll go through these in a couple of weeks, it's probably not productive for people who don't know the C++ std::lib well to bother analysing the suggestions.

[Bug c/106569] enhancement: use STL algorithm instead of a raw loop

2022-08-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106569 --- Comment #6 from Jonathan Wakely --- (In reply to David Binderman from comment #2) > According to > > https://cplusplus.com/reference/algorithm/any_of/ cplusplus.com is garbage, use cppreference.com

[Bug c/106569] enhancement: use STL algorithm instead of a raw loop

2022-08-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106569 --- Comment #5 from Jonathan Wakely --- (In reply to David Binderman from comment #0) > Static analyser cppcheck can produce these style messages for gcc trunk > source code: > > $ fgrep useStlAlgorithm cppcheck.20220809.out > trunk.git/gcc/ana

[Bug c/106569] enhancement: use STL algorithm instead of a raw loop

2022-08-09 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106569 --- Comment #4 from David Binderman --- (In reply to Martin Liška from comment #3) > > My best guess is that if gcc trunk is written in some recent version of C++, > > then all that recent version can be used. > > We are written in C++11, is st

[Bug c/106569] enhancement: use STL algorithm instead of a raw loop

2022-08-09 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106569 --- Comment #3 from Martin Liška --- > My best guess is that if gcc trunk is written in some recent version of C++, > then all that recent version can be used. We are written in C++11, is std::find_if available in the given standard?

[Bug c/106569] enhancement: use STL algorithm instead of a raw loop

2022-08-09 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106569 --- Comment #2 from David Binderman --- (In reply to Richard Biener from comment #1) > I find those less obvious, for example does std::any_of guarantee some > evaluation order? I also find any_of less obvious, but that's because my working kno

[Bug c/106569] enhancement: use STL algorithm instead of a raw loop

2022-08-09 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106569 --- Comment #1 from Richard Biener --- I find those less obvious, for example does std::any_of guarantee some evaluation order?