summaryrefslogtreecommitdiffstats
path: root/config/gnu-fflags
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-04-05 15:50:08 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-04-05 15:50:08 (GMT)
commit57f5d00a43421e4d2847d55560e4015f28cf162f (patch)
treee4fd18aca4f73eeb3bc8ca4ca115150f2b91abd4 /config/gnu-fflags
parent7a41367a130a615f06e5c35154abbdc621c7c6b7 (diff)
downloadhdf5-57f5d00a43421e4d2847d55560e4015f28cf162f.zip
hdf5-57f5d00a43421e4d2847d55560e4015f28cf162f.tar.gz
hdf5-57f5d00a43421e4d2847d55560e4015f28cf162f.tar.bz2
TRILAB-192 add c++ and fortran warnings build systems one file
Diffstat (limited to 'config/gnu-fflags')
-rw-r--r--config/gnu-fflags50
1 files changed, 30 insertions, 20 deletions
diff --git a/config/gnu-fflags b/config/gnu-fflags
index 185a4c6..2859158 100644
--- a/config/gnu-fflags
+++ b/config/gnu-fflags
@@ -17,6 +17,20 @@
# if the compiler is not GNU; otherwise `f9x_flags_set' is set to `yes'
#
+#
+# Prepend `$srcdir/config/gnu-warnings/` to the filename suffix(es) given as
+# subroutine argument(s), remove comments starting with # and ending
+# at EOL, replace spans of whitespace (including newlines) with spaces,
+# and re-emit the file(s) thus filtered on the standard output stream.
+#
+load_gnu_arguments()
+{
+ set -- $(for arg; do
+ sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors
+ done)
+ IFS=' ' echo "$*"
+}
+
# Get the compiler version in a way that works for GNU fortran
# gfortran unless a compiler version is already known
#
@@ -95,8 +109,8 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
# Symbols #
###########
- SYMBOLS_FCFLAGS="-g"
NO_SYMBOLS_FCFLAGS="-s"
+ SYMBOLS_FCFLAGS="-g"
#############
# Profiling #
@@ -125,8 +139,7 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
# General #
###########
- H5_FCFLAGS="$H5_FCFLAGS -pedantic -Wall -Wextra -Wunderflow -Wimplicit-interface -Wsurprising"
- H5_FCFLAGS="$H5_FCFLAGS -Waliasing -Wcharacter-truncation"
+ H5_FCFLAGS="$H5_CFLAGS $(load_gnu_arguments gfort-general)"
#############################
# Version-specific warnings #
@@ -134,48 +147,45 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
# gfortran 4.3 (nothing new)
- # gfortran 4.4
+ # gfortran >= 4.4
if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 4; then
- H5_FCFLAGS="$H5_FCFLAGS -Warray-temporaries -Wintrinsics-std"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.4)"
fi
- # gfortran 4.5
+ # gfortran >= 4.5
if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 5; then
- H5_FCFLAGS="$H5_FCFLAGS -Wimplicit-procedure"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.5)"
fi
# gfortran 4.6 (nothing new)
- # gfortran 4.7
+ # gfortran >= 4.7
if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 7; then
- H5_FCFLAGS="$H5_FCFLAGS -Wreal-q-constant -Wfunction-elimination"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.7)"
fi
- # gfortran 4.8
+ # gfortran >= 4.8
if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 8; then
- H5_FCFLAGS="$H5_FCFLAGS -Wrealloc-lhs -Wrealloc-lhs-all"
- # Turn off warnings for passing non-ANSI types to BIND().
- # We pass a lot of hid_t, etc. types so this generates a LOT of spurious warnings.
- H5_FCFLAGS="$H5_FCFLAGS -Wno-c-binding-type"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.8)"
fi
# gfortran 4.9 (nothing new)
- # gfortran 5
+ # gfortran >= 5
if test $f9x_vers_major -ge 5; then
- H5_FCFLAGS="$H5_FCFLAGS -Wuse-without-only"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-5)"
fi
- # gfortran 6
+ # gfortran >= 6
if test $f9x_vers_major -ge 6; then
- H5_FCFLAGS="$H5_FCFLAGS -Winteger-division"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-6)"
fi
# gfortran 7 (nothing new)
- # gfortran 8
+ # gfortran >= 8
if test $f9x_vers_major -ge 8; then
- H5_FCFLAGS="$H5_FCFLAGS -Wfrontend-loop-interchange"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-8)"
fi
# gfortran 9 (nothing new)