diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2021-03-25 02:11:34 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2021-03-25 02:11:34 (GMT) |
commit | 711d12bb586b23d5bdea4f57fe0101255324cc78 (patch) | |
tree | d7a72c80f662482628a6cbbc90b2767531d93167 /configure.ac | |
parent | 67cfa2396ce633d01138069f6c0081bbadb1e4a3 (diff) | |
download | hdf5-711d12bb586b23d5bdea4f57fe0101255324cc78.zip hdf5-711d12bb586b23d5bdea4f57fe0101255324cc78.tar.gz hdf5-711d12bb586b23d5bdea4f57fe0101255324cc78.tar.bz2 |
Brings the 'warnings-as-errors' changes from develop
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index bc5f42b..f1d99c8 100644 --- a/configure.ac +++ b/configure.ac @@ -131,14 +131,10 @@ AC_SUBST([AR_FLAGS]) ## H5_CFLAGS (and company) are for CFLAGS that should be used on HDF5, but ## not exported to h5cc (or h5fc, etc.) ## -## H5_ECFLAGS (and company) are for warnings that should be treated as errors. -## AC_SUBST([H5_CFLAGS]) -AC_SUBST([H5_ECFLAGS]) AC_SUBST([H5_CPPFLAGS]) AC_SUBST([H5_FCFLAGS]) AC_SUBST([H5_CXXFLAGS]) -AC_SUBST([H5_ECXXFLAGS]) AC_SUBST([H5_JNIFLAGS]) AC_SUBST([H5_JAVACFLAGS]) AC_SUBST([H5_JAVAFLAGS]) @@ -2230,6 +2226,45 @@ case "X-$DEV_WARNINGS" in esac ## ---------------------------------------------------------------------- +## Check if we should consider certain compiler warnings as errors +## +## These should NOT be on by default as the risk of breakage is high +## when compiling HDF5 on new (or new versions) of platforms and +## compilers. It can also cause failures when header files we have no +## control over (e.g. MPI, HDFS) raise warnings. +## +AC_MSG_CHECKING([enable warnings as errors]) +AC_ARG_ENABLE([warnings-as-errors], + [AS_HELP_STRING([--enable-warnings-as-errors], + [Determines whether certain warnings will be + considered errors. This is mainly for use + by HDF5 library developers. + [default=no] + ])], + [WARNINGS_AS_ERRORS=$enableval]) + +## Set default +if test "X-$WARNINGS_AS_ERRORS" = X- ; then + WARNINGS_AS_ERRORS=no +fi + +case "X-$WARNINGS_AS_ERRORS" in + X-yes) + H5_CFLAGS="$H5_CFLAGS $H5_ECFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $H5_ECXXFLAGS" + AC_MSG_RESULT([yes]) + ;; + X-no) + H5_CFLAGS="$H5_CFLAGS $H5_NECFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $H5_NECXXFLAGS" + AC_MSG_RESULT([no]) + ;; + *) + AC_MSG_ERROR([Unrecognized value: $WARNINGS_AS_ERRORS]) + ;; +esac + +## ---------------------------------------------------------------------- ## Check if the compiler should use profiling flags/settings ## AC_MSG_CHECKING([profiling]) |