ci: Set -Werror for all CI builds #938
pull real-or-random wants to merge 6 commits into bitcoin-core:master from real-or-random:202105-ci-werror changing 5 files +94 −63-
real-or-random commented at 12:03 pm on May 6, 2021: contributorLet’s see if that passes…
-
real-or-random commented at 1:33 pm on May 6, 2021: contributor
Uff ok, this is failing for multiple reasons:
- setting
CFLAGS=-Werrorduringconfigureis a bad idea because then all the compilation checks run byconfigureuse this and produce wrong results (these are the DISTCHECK and x86 asm failures) - the mingw libtool build produces warnings that are not our responsibility, see #923…
Fixing the first item is a little bit annoying. We could simply patch the generated
Makefilebut that’s pretty ugly. So we’ll better add some logic.It would be nice to call
./configurenormally but thenmake CFLAGS=-Werrorbut this would override all the other settings inCFLAGS. According to https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html, it would anyway be cleaner to set our-Walletc inAM_CFLAGSbut even thenCFLAGS=-Werrorwould override-O2for example.I believe a better way would be to have some maintainer variable with additional flags that can be set from the outside like
make EXTRACFLAGS=-Werror. Or have some--enable-werroror--enable-maintainer-modeforconfigure. I’ll probably try one of those options. Happy to hear opinions. - setting
-
gmaxwell commented at 5:07 am on May 9, 2021: contributor
An
enable-werroris the sort of thing I’d expect (maintainer mode sounds like it would get confused with AM_MAINTAINER_MODE).The only concern I have with EXTRACFLAGS is just that it gets into my environment and then messes up my tests but is weird enough that I don’t think to look for it. :P Is there any particular reason it needs to rerun both ways such that rerunning configure is a concern?
However its setup it should be done in a way that makes it relatively easy to drop on some CI builds. Because if some build starts throwing false positives it may be best to ignore it (e.g. if it’s S390 or some other weird config and silencing it requires hurting performance or crapping up the codebase), or maybe not, but the decision shouldn’t be driven by having to all-or-nothing the Werror or dropping the build.
-
real-or-random force-pushed on May 12, 2021
-
real-or-random force-pushed on May 12, 2021
-
real-or-random commented at 9:43 am on May 12, 2021: contributor
The only concern I have with EXTRACFLAGS is just that it gets into my environment and then messes up my tests but is weird enough that I don’t think to look for it.
I ended up doing this (naming it
WERROR_CFLAGS) because we anyway need some free text variable for specifying fine-grained-Wno-errorflags, and having a user-facing configure option is not tremendously helpful anyway. If users want-Werrorthey can always setCFLAGS.Let’s see what Cirrus says.
-
721928361d
build: Use own variable SECP_CFLAGS instead of touching user CFLAGS
Fixes one of the items in #923, namely the warnings of the form '_putenv' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes] This also cleans up the way we add CFLAGS, in particular flags enabling warnings. Now we perform some more fine-grained checking for flag support, which is not strictly necessary but the changes also help to document autoconf.ac. -
build: Enable -Wcast-align=strict warning 98158d4fc7
-
build: List *CPPFLAGS before *CFLAGS like on the compiler command line 303a28188f
-
595efa0104
build: Ensure that configure's compile checks default to -O2
Fixes #896.
-
build: Add hidden WERROR_CFLAGS variable for testing and CI 1b6bef4006
-
8d8cd482e1
ci: Make compiler warning into errors on CI
This also tidies the list of environment variables in .cirrus.yml.
-
real-or-random force-pushed on May 13, 2021
-
real-or-random closed this on May 13, 2021
-
real-or-random commented at 7:38 pm on May 13, 2021: contributorClosed in favor of https://github.com/bitcoin-core/secp256k1/pull/944
-
real-or-random cross-referenced this on May 13, 2021 from issue Various improvements related to CFLAGS by real-or-random
This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-11-17 01:15 UTC
More mirrored repositories can be found on mirror.b10c.me