[webkit-dev] -Wpessimizing-move and -Wredundant-move

Xan xan.lopez at gmail.com
Mon Mar 18 14:41:22 PDT 2019

I recently had to test GCC 9 and fixed one of the worst offenders in terms
of number of warnings when compiling JSC. See:

On Mon, Mar 18, 2019, 22:36 Michael Catanzaro <mcatanzaro at igalia.com> wrote:

> Hi,
> GCC 9 has new -Wpessimizing-move ("warning: moving a local object in a
> return statement prevents copy elision") and -Wredundant-move
> ("warning: redundant move in return statement") warnings. These are
> enabled by -Wextra (which we use) and will be triggered by code like:
> return WTFMove(foo);
> when foo is a copyable type. This idiom is only appropriate if foo is a
> noncopyable (move-only) type. We have many, many instances of such
> code. I'm trying to fix them. Please don't add more! (It's easy enough
> to disable the warnings, but they're there for a reason.)
> Thanks,
> Michael
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20190318/c0dabf27/attachment.html>

More information about the webkit-dev mailing list