Nicolai Hähnle via llvm-dev
2020-Feb-15 19:34 UTC
[llvm-dev] Coding style and warning spam: redundant std::move?
Hi all, GCC 9 introduced a new warning, -Wredundant-move, which is enabled by default when building LLVM and produces what looks like at least thousands of hits. https://reviews.llvm.org/D74672 is a sample of the kind of changes pointed out by this warning, more explanations are in this blog post: https://developers.redhat.com/blog/2019/04/12/understanding-when-not-to-stdmove-in-c/ What do people think should be done here? 1. Disable -Wredundant-move? 2. Fix it all (seems daunting to do manually)? 3. Encourage clang/clang-tidy developers to add this warning and add a clang-tidy rule to fix it automatically? My personal opinion is that while the review linked above should be committed, it's ultimately a drop in the ocean and #3 is the way to go. In the meantime, I'm certainly going to disable -Wredundant-move locally, but should that also be done by default for gcc in the CMakeLists.txt? Cheers, Nicolai -- Lerne, wie die Welt wirklich ist, aber vergiss niemals, wie sie sein sollte.
Mehdi AMINI via llvm-dev
2020-Feb-15 20:08 UTC
[llvm-dev] Coding style and warning spam: redundant std::move?
On Sat, Feb 15, 2020 at 11:35 AM Nicolai Hähnle via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi all, > > GCC 9 introduced a new warning, -Wredundant-move, which is enabled by > default when building LLVM and produces what looks like at least > thousands of hits. > > https://reviews.llvm.org/D74672 is a sample of the kind of changes > pointed out by this warning, more explanations are in this blog post: > > https://developers.redhat.com/blog/2019/04/12/understanding-when-not-to-stdmove-in-c/ > > What do people think should be done here? > > 1. Disable -Wredundant-move? > 2. Fix it all (seems daunting to do manually)? > 3. Encourage clang/clang-tidy developers to add this warning and add a > clang-tidy rule to fix it automatically? > > My personal opinion is that while the review linked above should be > committed, it's ultimately a drop in the ocean and #3 is the way to > go. >+1> > In the meantime, I'm certainly going to disable -Wredundant-move > locally, but should that also be done by default for gcc in the > CMakeLists.txt? >I'd support this as well! Thanks! -- Mehdi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200215/af34c68b/attachment.html>