spack/lib/spack/env
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
..
aocc
arm
case-insensitive
cce Cray support: use linux platform for newer craype versions (#29392) 2022-11-04 14:52:11 -07:00
clang
fj
gcc
intel
nag
nvhpc
oneapi Support packages which need to explicitly refer to dpcpp by name (#27168) 2021-12-02 15:49:20 -08:00
pgi
rocmcc rocmcc compiler: initial commit based on aocc and clang (#28575) 2022-03-03 14:34:22 -07:00
xl
xl_r
c89
c99
c++
cc Control Werror by converting to Wno-error (#30882) 2022-11-23 12:29:17 -08:00
cpp
f77
f90
f95
fc
ftn
ld
ld.gold Add ld.gold and ld.lld compiler wrapper (#25626) 2021-08-27 13:16:26 +02:00
ld.lld Add ld.gold and ld.lld compiler wrapper (#25626) 2021-08-27 13:16:26 +02:00