[lld] r298082 - [ELF] - Fix warning.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 12:38:19 PDT 2017


On Fri, Mar 17, 2017 at 6:15 AM, George Rimar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: grimar
> Date: Fri Mar 17 08:15:35 2017
> New Revision: 298082
>
> URL: http://llvm.org/viewvc/llvm-project?rev=298082&view=rev
> Log:
> [ELF] - Fix warning.
>
> Writer.cpp:361:3: warning: suggest parentheses around assignment used as
> truth value [-Wparentheses]
>
> Modified:
>     lld/trunk/ELF/Writer.cpp
>
> Modified: lld/trunk/ELF/Writer.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp
> ?rev=298082&r1=298081&r2=298082&view=diff
> ============================================================
> ==================
> --- lld/trunk/ELF/Writer.cpp (original)
> +++ lld/trunk/ELF/Writer.cpp Fri Mar 17 08:15:35 2017
> @@ -358,8 +358,8 @@ template <class ELFT> void Writer<ELFT>:
>      Add(In<ELFT>::BuildId);
>    }
>
> -  if (In<ELFT>::Common = createCommonSection<ELFT>())
> -    Add(In<ELFT>::Common);
> +  if (auto *Sec = createCommonSection<ELFT>())
> +    Add(Sec);


Can you always keep new code consistent with existing code? I wouldn't use
`auto` as the other code in this file doesn't use `auto` in the context
like this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170317/406fdbcc/attachment.html>


More information about the llvm-commits mailing list