[llvm-dev] Question about GCC warnings

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 18 12:45:37 PDT 2019


I don't think we've got any formal policy here - and some folks appear to
be trying to preserve GCC warning cleanliness for the LLVM build (but I
imagine that work lags new GCC releases, etc)

One more aggressive stance (which I kind of like): Disable any non-clang
warning that has an unfavorable false positive (even if we lose the true
positives) - improve Clang by adding any missing warnings if they're
sufficiently valuable. (& if Clang warnings have false positives - fix
those in clang rather than working around them in the codebase)

- Dave

On Thu, Jul 18, 2019 at 5: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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190718/121393d9/attachment.html>


More information about the llvm-dev mailing list