diff options
author | David Young <dyoung@hdfgroup.org> | 2021-10-06 21:24:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-06 21:24:22 (GMT) |
commit | 174f4275bab93e734fafd94d9b69929f3aeb963c (patch) | |
tree | c3699e3f94c4ef098e7cd94c2c93c3fc2fd39519 /config/clang-cxxflags | |
parent | a08059894bc85655e4ed895fd5c5f4c1ba64a2f6 (diff) | |
download | hdf5-174f4275bab93e734fafd94d9b69929f3aeb963c.zip hdf5-174f4275bab93e734fafd94d9b69929f3aeb963c.tar.gz hdf5-174f4275bab93e734fafd94d9b69929f3aeb963c.tar.bz2 |
To reduce maintenance effort, delete the `noerror-` variants of the compiler flags files (#1033)
* Avoid maintenance headaches: delete the `noerror-` variants of the
compiler flags files, since they essentially duplicate the `error-`
files modulo the replacement of `-Werror=` with `-W` and any changes in
comments. (I verified the duplication with a script.)
For autoconf, reinstate the use of the `demote_errors` shell function to
derive the `noerror-` content from the `error-` content. `demote_errors`
replaces `-Werror=` with `-W` when `WARNINGS_AS_ERRORS` is `no`.
Slightly reorder `configure.ac` so that the setting of
`WARNINGS_AS_ERRORS` takes effect before the `error-` files are sourced.
* Take a stab at updating the CMake files to match the changes I made to
the autoconf files to remove `noerror-` files. I'm not much of a CMake
user so these changes are quite rough.
Looks like the duplication can be reduced with the introduction of a new
macro.
* Delete `noerror-` files from the MANIFEST.
* Reduce duplication in the CMake files: perform the
HDF5_ENABLE_WARNINGS_AS_ERRORS test once in the ADD_H5_FLAGS macro.
* Add a release note.
Diffstat (limited to 'config/clang-cxxflags')
-rw-r--r-- | config/clang-cxxflags | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/config/clang-cxxflags b/config/clang-cxxflags index c585ce7..76f095f 100644 --- a/config/clang-cxxflags +++ b/config/clang-cxxflags @@ -20,15 +20,15 @@ # # For now, do not promote any warnings to errors. # -PROMOTE_ERRORS_DFLT=no +WARNINGS_AS_ERRORS_DFLT=no # # This filter rewrites -Werror= as -W, in that way demoting warnings -# promoted to errors back to warnings, if PROMOTE_ERRORS is no. +# promoted to errors back to warnings, if WARNINGS_AS_ERRORS is no. # demote_errors() { - if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + if [ ${WARNINGS_AS_ERRORS:-${WARNINGS_AS_ERRORS_DFLT}} = no ]; then sed 's,-Werror=,-W,g' else cat @@ -44,7 +44,7 @@ demote_errors() load_clang_arguments() { set -- $(for arg; do - sed 's,#.*$,,' $srcdir/config/clang-warnings/${arg} + sed 's,#.*$,,' $srcdir/config/clang-warnings/${arg} | demote_errors done) IFS=' ' echo "$*" } @@ -161,7 +161,6 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_clang_arguments general)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_clang_arguments error-general)" - H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_clang_arguments noerror-general)" ###################### # Developer warnings # |