spack/etc/spack/defaults
Tom Scogland 0182603609
Control Werror by converting to Wno-error (#30882)
Using `-Werror` is good practice for development and testing, but causes us a great
deal of heartburn supporting multiple compiler versions, especially as newer compiler
versions add warnings for released packages.  This PR adds support for suppressing
`-Werror` through spack's compiler wrappers.  There are currently three modes for
the `flags:keep_werror` setting:

* `none`: (default) cancel all `-Werror`, `-Werror=*` and `-Werror-*` flags by
  converting them to `-Wno-error[=]*` flags
* `specific`: preserve explicitly selected warnings as errors, such as
  `-Werror=format-truncation`, but reverse the blanket `-Werror`
* `all`: keeps all `-Werror` flags

These can be set globally in config.yaml, through the config command-line flags, or
overridden by a particular package (some packages use Werror as a proxy for determining
support for other compiler features).  We chose to use this approach because:

1. removing `-Werror` flags entirely broke *many* build systems, especially autoconf
   based ones, because of things like checking `-Werror=feature` and making the
   assumption that if that did not error other flags related to that feature would also work
2. Attempting to preserve `-Werror` in some phases but not others caused similar issues
3. The per-package setting came about because some packages, even with all these
   protections, still use `-Werror` unsafely.  Currently there are roughly 3 such packages
   known.
2022-11-23 12:29:17 -08:00
..
cray Don't set LD_LIBRARY_PATH by default on Linux (#28354) 2022-08-11 09:33:08 -05:00
darwin Relative paths in default prefix_inspections start with ./ (#31867) 2022-08-23 12:54:12 -07:00
linux Don't set LD_LIBRARY_PATH by default on Linux (#28354) 2022-08-11 09:33:08 -05:00
windows Windows: fix library loading and enable Clingo bootstrapping (#33400) 2022-10-31 09:36:52 -07:00
bootstrap.yaml Update metadata for bootstrapping (#33665) 2022-11-03 09:05:03 +00:00
concretizer.yaml concretizer:unify:true as a default (#31787) 2022-11-07 15:38:24 +01:00
config.yaml Control Werror by converting to Wno-error (#30882) 2022-11-23 12:29:17 -08:00
mirrors.yaml Use AWS CloudFront for source mirror (#23978) 2021-05-28 00:18:30 -07:00
modules.yaml Relative paths in default prefix_inspections start with ./ (#31867) 2022-08-23 12:54:12 -07:00
packages.yaml go,gcc: Support external go compilers for Go bootstrap (#27769) 2022-10-18 10:18:49 -07:00
repos.yaml Add "default" configuration scope. 2016-07-19 17:10:17 -07:00