[llvm-dev] Question about GCC warnings

Erik Hogeman via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 18 05:00:56 PDT 2019


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190718/59d0d02e/attachment.html>


More information about the llvm-dev mailing list