[llvm-dev] Enable compiler warnings

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 23 12:18:14 PDT 2020


The latter should be sufficient.

It's possible that the buildbot is using a different compiler with
different warning implementations (& the LLVM CMake build does
enable/disable certain warnings on a per-compiler basis because of
inconsistencies in their implementations, or some of them being lower
quality/buggy/etc).

Have you tried introducing some fairly "obvious" code that should
elicit a warning to see if your local build is identifying them?
Missing a return statement in a non-void-returning function should
probably be caught by nearly any compiler... (though maybe that's
-Werror by default in some compilers, so might not be the best
test)... not sure what the best example would be, unused variable,
perhaps? (just add a local variable to a function with no use of that
variable)

On Wed, Sep 23, 2020 at 12:07 PM Paul C. Anagnostopoulos via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> Can someone tell me the magic CMake changes that I need to make so that the C++ compiler will display warnings and terminate? I broke the build yesterday because I had not seen a warning that then showed up in the build.
>
> I have these two options set in CMakeCache.txt:
>
> //Enable compiler warnings.
> LLVM_ENABLE_WARNINGS:BOOL=ON
>
> //Fail and stop if a warning is triggered.
> LLVM_ENABLE_WERROR:BOOL=ON
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list