From d41b70b84f0f0cd4d05463234ddcb19461d7b3f9 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Tue, 2 Nov 2021 14:57:14 -0500 Subject: Merge Github #1019 - add Fortran developer flags #1090 (#1149) --- MANIFEST | 2 +- config/cmake/HDFFortranCompilerFlags.cmake | 10 +++++----- config/gnu-warnings/developer-gfort-5 | 1 + config/gnu-warnings/gfort-5 | 1 - configure.ac | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 config/gnu-warnings/developer-gfort-5 delete mode 100644 config/gnu-warnings/gfort-5 diff --git a/MANIFEST b/MANIFEST index bc30f43..effcce3 100644 --- a/MANIFEST +++ b/MANIFEST @@ -181,7 +181,7 @@ ./config/gnu-warnings/general ./config/gnu-warnings/gfort-general ./config/gnu-warnings/gfort-4.8 -./config/gnu-warnings/gfort-5 +./config/gnu-warnings/developer-gfort-5 ./config/gnu-warnings/gfort-6 ./config/gnu-warnings/gfort-8 ./config/gnu-warnings/no-cxx-developer-4.8 diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index 94c40aa..754259e 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -79,7 +79,6 @@ if (NOT MSVC AND NOT MINGW) endif () if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") - # Append more extra warning flags that only gcc 4.8+ knows about if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8) ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.8") @@ -91,10 +90,11 @@ if (NOT MSVC AND NOT MINGW) #endif () # Append more extra warning flags that only gcc 5.x+ knows about - # do not include -Wuse-without-only - #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0) - # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5") - #endif () + if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0) + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-gfort-5") + endif () + endif () # Append more extra warning flags that only gcc 6.x+ knows about if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0) diff --git a/config/gnu-warnings/developer-gfort-5 b/config/gnu-warnings/developer-gfort-5 new file mode 100644 index 0000000..c5d3850 --- /dev/null +++ b/config/gnu-warnings/developer-gfort-5 @@ -0,0 +1 @@ +-Wuse-without-only diff --git a/config/gnu-warnings/gfort-5 b/config/gnu-warnings/gfort-5 deleted file mode 100644 index c5d3850..0000000 --- a/config/gnu-warnings/gfort-5 +++ /dev/null @@ -1 +0,0 @@ --Wuse-without-only diff --git a/configure.ac b/configure.ac index 5256f3d..e767f0d 100644 --- a/configure.ac +++ b/configure.ac @@ -2132,6 +2132,7 @@ AC_SUBST([DEV_WARNINGS]) case "X-$DEV_WARNINGS" in X-yes) H5_CFLAGS="$H5_CFLAGS $DEVELOPER_WARNING_CFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $DEVELOPER_WARNING_FCFLAGS" AC_MSG_RESULT([yes]) ;; X-no) -- cgit v0.12