[llvm-dev] Question about GCC warnings

Brian Cain via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 18 12:49:33 PDT 2019


Are the initializer_list<>s in question temporary arguments?  Maybe the
warning is triggering because the ArrayRef will outlive the
initializer_list<>.

On Thu, Jul 18, 2019 at 7:01 AM Erik Hogeman via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi,
>
> Building LLVM with a newer GCC version seems to generate several compiler
> warnings, some of which look like false positives. For example, the
> '-Winit-list-lifetime' warning added in GCC9 triggers for one of the
> constructors for ArrayRef, the one taking an initializer_list.
>
> How are false positive warnings dealt with in LLVM in general? It's of
> course possible to just ignore them or use compiler flags to disable them,
> but with that I think you would risk missing other actual meaningful
> warnings.
> Would it make sense to add explicit diagnostic pragmas in the code for
> such cases, to only silence the warning where they are known to be false
> positives, or would such a patch be likely to face pushback during review?
>
> I apologize if this question is already answered somewhere in the
> documentation, I tried looking there first but I could not find anything.
>
> Cheers,
> Erik
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


-- 
-Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190718/15be715c/attachment.html>


More information about the llvm-dev mailing list