summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-08-23 15:48:14 (GMT)
committerGitHub <noreply@github.com>2022-08-23 15:48:14 (GMT)
commitf020d129b2ed173c8d0075d670214440013d7daf (patch)
treed5bc621f4469e0ee66f99c8d89f6de0813fc0a73 /config
parent21ec3378558cdc642ff49963c13ca18d8e49349c (diff)
downloadhdf5-f020d129b2ed173c8d0075d670214440013d7daf.zip
hdf5-f020d129b2ed173c8d0075d670214440013d7daf.tar.gz
hdf5-f020d129b2ed173c8d0075d670214440013d7daf.tar.bz2
Corrects more Fortran warnings (#2059)
* Moves -Wunused-dummy-arguments to the developer warnings since this generates a lot of spurious, unfixable noise due to things like callback wrappers * Changes the return cast in h5fget_fileno_c, fixes a comment, and comment on potential badness * Initializes a variable in tH5L_F03.F90 to quiet a 'maybe uninitialized' warning
Diffstat (limited to 'config')
-rw-r--r--config/cmake/HDFFortranCompilerFlags.cmake11
-rw-r--r--config/gnu-fflags5
-rw-r--r--config/gnu-warnings/gfort-developer-5 (renamed from config/gnu-warnings/developer-gfort-5)0
-rw-r--r--config/gnu-warnings/gfort-developer-general3
-rw-r--r--config/gnu-warnings/gfort-no-developer-general3
5 files changed, 16 insertions, 6 deletions
diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake
index 13e9902..7fdc3f8 100644
--- a/config/cmake/HDFFortranCompilerFlags.cmake
+++ b/config/cmake/HDFFortranCompilerFlags.cmake
@@ -54,10 +54,6 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERS
endif ()
endif ()
-#-----------------------------------------------------------------------------
-# CDash is configured to only allow 3000 warnings, so
-# break into groups (from the config/gnu-flags file)
-#-----------------------------------------------------------------------------
if (NOT MSVC AND NOT MINGW)
# General flags
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
@@ -65,6 +61,11 @@ if (NOT MSVC AND NOT MINGW)
list (APPEND HDF5_CMAKE_Fortran_FLAGS "-free")
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-general")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-general")
+ else ()
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-no-developer-general")
+ endif ()
list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ffree-form" "-fimplicit-none")
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0 AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6)
list (APPEND HDF5_CMAKE_Fortran_FLAGS "-std=f2008ts")
@@ -92,7 +93,7 @@ if (NOT MSVC AND NOT MINGW)
# Append more extra warning flags that only gcc 5.x+ knows about
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")
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-5")
endif ()
endif ()
diff --git a/config/gnu-fflags b/config/gnu-fflags
index 1333ce5..0230e5c 100644
--- a/config/gnu-fflags
+++ b/config/gnu-fflags
@@ -150,6 +150,9 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-general)"
+ NO_DEVELOPER_WARNING_FCFLAGS="$NO_DEVELOPER_WARNING_FCFLAGS $(load_gnu_arguments gfort-no-developer-general)"
+ DEVELOPER_WARNING_FCFLAGS="$DEVELOPER_WARNING_FCFLAGS $(load_gnu_arguments gfort-developer-general)"
+
#############################
# Version-specific warnings #
#############################
@@ -163,7 +166,7 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
# gfortran >= 5
if test $f9x_vers_major -ge 5; then
- DEVELOPER_WARNING_FCFLAGS="$DEVELOPER_WARNING_FCFLAGS $(load_gnu_arguments developer-gfort-5)"
+ DEVELOPER_WARNING_FCFLAGS="$DEVELOPER_WARNING_FCFLAGS $(load_gnu_arguments gfort-developer-5)"
fi
# gfortran >= 6
diff --git a/config/gnu-warnings/developer-gfort-5 b/config/gnu-warnings/gfort-developer-5
index c5d3850..c5d3850 100644
--- a/config/gnu-warnings/developer-gfort-5
+++ b/config/gnu-warnings/gfort-developer-5
diff --git a/config/gnu-warnings/gfort-developer-general b/config/gnu-warnings/gfort-developer-general
new file mode 100644
index 0000000..dde15fe
--- /dev/null
+++ b/config/gnu-warnings/gfort-developer-general
@@ -0,0 +1,3 @@
+# There is no easy way in Fortran to indicate parameters are intentionally
+# unused and many callbacks will have these, generating a lot of noise.
+-Wunused-dummy-argument
diff --git a/config/gnu-warnings/gfort-no-developer-general b/config/gnu-warnings/gfort-no-developer-general
new file mode 100644
index 0000000..bfcba22
--- /dev/null
+++ b/config/gnu-warnings/gfort-no-developer-general
@@ -0,0 +1,3 @@
+# There is no easy way in Fortran to indicate parameters are intentionally
+# unused and many callbacks will have these, generating a lot of noise.
+-Wno-unused-dummy-argument