summaryrefslogtreecommitdiffstats
path: root/config
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
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')
-rw-r--r--config/cmake/HDFCompilerFlags.cmake37
-rw-r--r--config/cmake/HDFFortranCompilerFlags.cmake131
-rw-r--r--config/gnu-cxxflags885
-rw-r--r--config/gnu-fflags50
-rw-r--r--config/gnu-flags52
-rw-r--r--config/gnu-warnings/cxx-general19
-rw-r--r--config/gnu-warnings/gfort-4.42
-rw-r--r--config/gnu-warnings/gfort-4.51
-rw-r--r--config/gnu-warnings/gfort-4.72
-rw-r--r--config/gnu-warnings/gfort-4.85
-rw-r--r--config/gnu-warnings/gfort-51
-rw-r--r--config/gnu-warnings/gfort-61
-rw-r--r--config/gnu-warnings/gfort-81
-rw-r--r--config/gnu-warnings/gfort-general12
-rw-r--r--config/intel-ifort-general1
-rw-r--r--config/intel-warnings-general8
16 files changed, 452 insertions, 756 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 03c6936..79e2bd2 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -133,6 +133,9 @@ if (NOT MSVC)
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general")
message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}")
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general")
+ endif ()
ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general")
# gcc automatically inlines based on the optimization level
# this is just a failsafe
@@ -302,6 +305,9 @@ if (HDF5_ENABLE_ALL_WARNINGS)
else ()
if (CMAKE_COMPILER_IS_GNUCC)
list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4})
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4})
+ endif ()
endif ()
endif ()
endif ()
@@ -322,6 +328,9 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS)
else ()
if (CMAKE_COMPILER_IS_GNUCC)
list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0})
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS0})
+ endif ()
endif ()
endif ()
endif ()
@@ -340,7 +349,12 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS)
list (APPEND HDF5_CMAKE_CXX_FLAGS "/W2")
endif ()
else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1})
+ if (CMAKE_COMPILER_IS_GNUCC)
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1})
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS1})
+ endif ()
+ endif ()
endif ()
endif ()
@@ -358,7 +372,12 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS)
list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
endif ()
else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2})
+ if (CMAKE_COMPILER_IS_GNUCC)
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2})
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS2})
+ endif ()
+ endif ()
endif ()
endif ()
@@ -376,7 +395,12 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
list (APPEND HDF5_CMAKE_CXX_FLAGS "/W4")
endif ()
else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3})
+ if (CMAKE_COMPILER_IS_GNUCC)
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3})
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS3})
+ endif ()
+ endif ()
endif ()
endif ()
@@ -387,7 +411,12 @@ option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF)
if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
message (STATUS "....Group Four warnings are enabled")
if (NOT MSVC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4})
+ if (CMAKE_COMPILER_IS_GNUCC)
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4})
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS4})
+ endif ()
+ endif ()
endif ()
endif ()
diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake
new file mode 100644
index 0000000..8d59cd0
--- /dev/null
+++ b/config/cmake/HDFFortranCompilerFlags.cmake
@@ -0,0 +1,131 @@
+#
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+
+macro (ADD_H5_FFLAGS h5_fflag_var infile)
+ file (STRINGS ${infile} TEST_FLAG_STREAM)
+ #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}")
+ list (LENGTH TEST_FLAG_STREAM len_flag)
+ if (len_flag GREATER 0)
+ math (EXPR _FP_LEN "${len_flag} - 1")
+ foreach (line RANGE 0 ${_FP_LEN})
+ list (GET TEST_FLAG_STREAM ${line} str_flag)
+ string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}")
+ #message (STATUS "str_flag=${str_flag}")
+ if (str_flag)
+ list (APPEND ${h5_fflag_var} "${str_flag}")
+ endif ()
+ endforeach ()
+ endif ()
+ #message (STATUS "h5_fflag_var=${${h5_fflag_var}}")
+endmacro ()
+
+message (STATUS "Warnings Configuration: default: ${CMAKE_Fortran_FLAGS}")
+
+#-----------------------------------------------------------------------------
+# Option to allow the user to disable compiler warnings
+#-----------------------------------------------------------------------------
+option (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF)
+if (HDF5_DISABLE_COMPILER_WARNINGS)
+ message (STATUS "....Compiler warnings are suppressed")
+ # MSVC uses /w to suppress warnings. It also complains if another
+ # warning level is given, so remove it.
+ if (MSVC)
+ set (HDF5_WARNINGS_BLOCKED 1)
+ string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}")
+ set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /W0")
+ endif ()
+ if (WIN32)
+ add_definitions (-D_CRT_SECURE_NO_WARNINGS)
+ endif ()
+ # Borland uses -w- to suppress warnings.
+ if (BORLAND)
+ set (HDF5_WARNINGS_BLOCKED 1)
+ set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w-")
+ endif ()
+
+ # Most compilers use -w to suppress warnings.
+ if (NOT HDF5_WARNINGS_BLOCKED)
+ set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w")
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# HDF5 library compile options
+#-----------------------------------------------------------------------------
+
+# General flags
+if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
+ ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-ifort-general")
+ list (APPEND CMAKE_Fortran_FLAGS "-stand f08 -free -implicitnone")
+elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
+ ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-general")
+ list (APPEND CMAKE_Fortran_FLAGS "-ffree-form -std=f2008 -fimplicit-none")
+elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI")
+ list (APPEND CMAKE_Fortran_FLAGS "-Mfreeform -Mdclchk -Mstandard -Mallocatable=03")
+endif ()
+message (STATUS "CMAKE_Fortran_FLAGS=${CMAKE_Fortran_FLAGS}")
+
+if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
+ # Append warning flags that only gcc 4.4+ knows about
+ ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.4")
+endif ()
+
+# Append more extra warning flags that only gcc 4.5+ know about
+if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.5)
+ ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.5")
+endif ()
+
+# Append more extra warning flags that only gcc 4.6+ know about
+#if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6)
+# ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.6")
+#endif ()
+
+# Append more extra warning flags that only gcc 4.7+ know about
+if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.7)
+ ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.7")
+endif ()
+
+# Append more extra warning flags that only gcc 4.8+ know about
+if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8)
+ ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.8")
+endif ()
+
+# Append more extra warning flags that only gcc 4.9+ know about
+#if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.9)
+# ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.9")
+#endif ()
+
+# Append more extra warning flags that only gcc 5.1+ know about
+if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0)
+ ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5")
+endif ()
+
+# Append more extra warning flags that only gcc 6.x+ know about
+if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0)
+ ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-6")
+endif ()
+
+# Append more extra warning flags that only gcc 7.x+ know about
+#if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0)
+# ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-7")
+#endif ()
+
+# Append more extra warning flags that only gcc 8.x+ know about
+if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0)
+ ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-8")
+endif ()
+
+# Append more extra warning flags that only gcc 9.x+ know about
+#if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 9.0)
+# ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-9")
+#endif ()
+
diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags
index f8a6d8c..9ae38f6 100644
--- a/config/gnu-cxxflags
+++ b/config/gnu-cxxflags
@@ -1,4 +1,4 @@
-# -*- shell-script -*-
+# -*- shell-script -*-
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@@ -17,19 +17,51 @@
# if the compiler is not GNU; otherwise `cxx_flags_set' is set to `yes'
#
+#
+# For now, do not promote any warnings to errors.
+#
+PROMOTE_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.
+#
+demote_errors()
+{
+ if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then
+ sed 's,-Werror=,-W,g'
+ else
+ cat
+ fi
+}
+
+#
+# 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 g++
# unless a compiler version is already known
#
# cxx_vendor: The compiler name: g++
# cxx_version: Version number: 2.91.60, 2.7.2.1
#
-if test X = "X$cxx_flags_set"; then
+if test "X-" = "X-$cxx_flags_set"; then
# PathScale compiler spits out gcc version string too. Need to
# filter it out.
# icc beginning with version 12 includes a "gcc version compatiblilty"
- # string, causing the gcc H5_CFLAGS to be erroneously added. The line
+ # string, causing the gcc H5_CXXFLAGS to be erroneously added. The line
# "grep -v 'icc version'" causes the discarding of any output
- # containing 'icc version'. The cc_version for icc is correctly determined
+ # containing 'icc version'. The cxx_version for icc is correctly determined
# and flags added in the intel-flags script.
cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 | grep -v 'PathScale' |\
grep -v '^icc.*version' |\
@@ -37,13 +69,13 @@ if test X = "X$cxx_flags_set"; then
cxx_vendor=`echo $cxx_version |sed 's/\([a-z]*\).*/\1/'`
cxx_version=`echo $cxx_version |sed 's/[-a-z]//g'`
if test X = "X$cxx_vendor" -a X != "X$cxx_version"; then
- cxx_vendor=g++
+ cxx_vendor=g++
fi
if test "-" != "$cxx_vendor-$cxx_version"; then
- echo "compiler '$CXX' is GNU $cxx_vendor-$cxx_version"
+ echo "compiler '$CXX' is GNU $cxx_vendor-$cxx_version"
fi
- # Some version numbers
+ # Get the compiler version numbers
cxx_vers_major=`echo $cxx_version | cut -f1 -d.`
cxx_vers_minor=`echo $cxx_version | cut -f2 -d.`
cxx_vers_patch=`echo $cxx_version | cut -f3 -d.`
@@ -53,10 +85,12 @@ if test X = "X$cxx_flags_set"; then
cxx_vers_all=`expr $cxx_vers_major '*' 1000000 + $cxx_vers_minor '*' 1000 + $cxx_vers_patch`
fi
-# Common g++ flags for various situations
-case "$cxx_vendor-$cxx_version" in
- g++*)
- # Architecture-specific flags
+if test "X-g++" = "X-$cxx_vendor"; then
+
+ ###############################
+ # Architecture-specific flags #
+ ###############################
+
arch=
case "$host_os-$host_cpu" in
# FreeBSD sets the information from "uname -m" to the general machine
@@ -84,742 +118,197 @@ case "$cxx_vendor-$cxx_version" in
;;
esac
- # Host-specific flags
- case "`hostname`" in
- sleipnir.ncsa.uiuc.edu)
- arch="$arch -pipe"
- ;;
- esac
-
- # General (copied from H5_CFLAGS)
- H5_CXXFLAGS="$H5_CXXFLAGS $arch -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wredundant-decls -Winline"
-
# C++-specific
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsign-promo -Woverloaded-virtual -Wold-style-cast -Weffc++ -Wreorder -Wnon-virtual-dtor -Wctor-dtor-privacy -Wabi"
+ H5_CXXFLAGS="$H5_CXXFLAGS $arch
+
+ ##############
+ # Production #
+ ##############
- # Production
# NDEBUG is handled explicitly by the configure script
- case "$cxx_vendor-$cxx_version" in
- g++-[34].*)
+ if test $cxx_vers_major -le 4; then
PROD_CXXFLAGS=
- ;;
- g++-[56].*)
+ else
PROD_CXXFLAGS="-fstdarg-opt"
- ;;
- *)
- PROD_CXXFLAGS="-finline-functions"
- ;;
- esac
+ fi
+
+ #########
+ # Debug #
+ #########
- # Debug
# NDEBUG is handled explicitly by the configure script
- # -g is hanled by the symbols flags
- case "$cxx_vendor-$cxx_version" in
- g++-[56].*)
- DEBUG_CXXFLAGS="-ftrapv -fno-common"
- ;;
- *)
+ # -g is handled by the symbols flags
+ if test $cxx_vers_major -le 4; then
DEBUG_CXXFLAGS=
- ;;
- esac
+ else
+ DEBUG_CXXFLAGS="-ftrapv -fno-common"
+ fi
+
+ ###########
+ # Symbols #
+ ###########
- # Symbols
NO_SYMBOLS_CXXFLAGS="-s"
SYMBOLS_CXXFLAGS="-g"
- # Profile
+ #############
+ # Profiling #
+ #############
+
PROFILE_CXXFLAGS="-pg"
- # Optimization
- case "$cxx_vendor-$cxx_version" in
- g++-[34].*)
+ ################
+ # Optimization #
+ ################
+
+ if test $cxx_vers_major -le 4; then
HIGH_OPT_CXXFLAGS="-O3"
DEBUG_OPT_CXXFLAGS=
- ;;
- g++-[56].*)
+ else
HIGH_OPT_CXXFLAGS="-O3"
DEBUG_OPT_CXXFLAGS="-Og"
- ;;
- *)
- HIGH_OPT_CXXFLAGS="-O"
- DEBUG_OPT_CXXFLAGS=
- ;;
- esac
+ fi
NO_OPT_CXXFLAGS="-O0"
- # Flags are set
- cxx_flags_set=yes
- ;;
-esac
-
-# Version-specific g++ flags
-#
-# Please follow the pattern below by adding new versions at the top, copying
-# the information from the previous version and adding modifications to that.
-case "$cxx_vendor-$cxx_version" in
-
-# Closer to the g++ 5.2 release, we should check for additional flags to
-# include and break it out into it's own section, like the other versions
-# below. -QAK
- g++-[56]*)
+ ############
+ # Warnings #
+ ############
- # Append warning flags from gcc-3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
+# First load the C warnings then add CXX warnings (if needed)
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
+ ###########
+ # General #
+ ###########
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments general)"
+ H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-general)"
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)"
+ #H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-cxx-general)"
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
+ ######################
+ # Developer warnings #
+ ######################
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
+ NO_DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments no-developer-general)
+ DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments developer-general)
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
+ #######################
+ # gcc 4 special cases #
+ #######################
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5"
-
- # Append more extra warning flags that only gcc 4.6+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
-
- # Append more extra warning flags that only gcc 4.7+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
-
- # Append more extra warning flags that only gcc 4.8+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsuggest-attribute=format"
+ # GCC 4.2 through 4.6
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.6)"
+ fi
- # Append more extra warning flags that only gcc 4.9+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdate-time -Wopenmp-simd"
+ # GCC 4.2 through 4.3
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.3)"
+ fi
- # (There was no release of gcc 5.0)
+ # GCC 4.5 through 4.6
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5-4.6)"
+ fi
- # Append more extra warning flags that only gcc 5.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Warray-bounds=2"
- ;;
+ # GCC 4.2 through 4.4
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -a $cc_vers_major -eq 4 -a $cc_vers_minor -le 4; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.4)"
+ fi
- g++-4.9*)
- # Append warning flags
+ # GCC 4.2 through the end of GCC 4 series
+ if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.last)"
+ fi
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
+ #############################
+ # Version-specific warnings #
+ #############################
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
+ # gcc >= 4.3
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.3)"
+ fi
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
+ # gcc >= 4.4
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.4)"
+ fi
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
+ # gcc >= 4.5
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.5)"
+ NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.5)"
+ fi
- # Append warning flags from gcc 3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
+ # gcc >= 4.6
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.6)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.6)"
+ NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.6)"
+ fi
- # Append warning flags from gcc 3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
+ # gcc >= 4.7
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.7)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.7)"
+ NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.7)"
+ fi
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
+ # gcc >= 4.8
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-4.8)"
+ NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-4.8)"
+ fi
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
+ # gcc >= 4.9
+ if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 9; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.9)"
+ fi
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
+ # gcc >= 5
+ if test $cc_vers_major -ge 5; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 5)"
+ H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-5)"
+ fi
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
+ # gcc >= 6
+ if test $cc_vers_major -ge 6; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 6)"
+ fi
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
+ # gcc >= 7
+ if test $cc_vers_major -ge 7; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 7)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-7)"
+ fi
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
+ # gcc 8
+ if test $cc_vers_major -ge 8; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 8)"
+ H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)"
+ DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments developer-8)"
+ NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gcc_arguments no-developer-8)"
+ fi
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5"
+ # gcc 9
+ if test $cc_vers_major -ge 9; then
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 9)"
+ fi
- # Append more extra warning flags that only gcc 4.6+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
+ #################
+ # Flags are set #
+ #################
+ cxx_flags_set=yes
+fi
- # Append more extra warning flags that only gcc 4.7+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
+# Version-specific g++ flags
- # Append more extra warning flags that only gcc 4.8+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsuggest-attribute=format"
# Append more extra warning flags that only gcc 4.9+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdate-time -Wopenmp-simd"
- ;;
-
- g++-4.8*)
- # Append warning flags
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5"
-
- # Append more extra warning flags that only gcc 4.6+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
-
- # Append more extra warning flags that only gcc 4.7+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
-
- # Append more extra warning flags that only gcc 4.8+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsuggest-attribute=format"
- ;;
-
- g++-4.7*)
- # Append warning flags
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow=5"
-
- # Append more extra warning flags that only gcc 4.6+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
-
- # Append more extra warning flags that only gcc 4.7+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
- ;;
-
- g++-4.6*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ knows about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-aliasing -Wstrict-overflow=5"
-
- # Append more extra warning flags that only gcc 4.6+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
- ;;
-
- g++-4.5*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc4.0+ knows about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
-
- # Append more extra warning flags that only gcc 4.5+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-aliasing -Wstrict-overflow=5"
- ;;
-
- g++-4.4*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
-
- # Append more extra warning flags that only gcc 4.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
- ;;
-
- g++-4.3*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations -Wvolatile-register-var"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
-
- # Append more extra warning flags that only gcc 4.3+ know about
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... -QAK
- H5_CXXFLAGS="$H5_CXXFLAGS -Wlogical-op -Wvla"
- ;;
-
- g++-4.2*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations -Wvolatile-register-var"
-
- # Append more extra warning flags that only gcc 4.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wstrict-overflow"
- ;;
-
- g++-4.1.*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # Enable more format checking flags, beyond the basic -Wformat included
- # in -Wall
- H5_CXXFLAGS="$H5_CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
-
- # Append more extra warning flags that only gcc 4.1+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wunsafe-loop-optimizations -Wvolatile-register-var"
- ;;
-
- g++-4.0*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # The "format=2" warning generates too many warnings about valid
- # usage in the library.
- #CXXFLAGS="$CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append warning flags from gcc-3.4* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
-
- # Append more extra warning flags that only gcc 4.0+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
- ;;
-
- g++-3.4*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # The "format=2" warning generates too many warnings about valid
- # usage in the library.
- #CXXFLAGS="$CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append warning flags from gcc-3.3* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
-
- # Append more extra warning flags that only gcc3.4+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Winvalid-pch"
-
- # Replace old -W flag with new -Wextra flag
- H5_CXXFLAGS="`echo $H5_CXXFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
- ;;
-
- g++-3.3*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append warning flags from gcc-3.2* case
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # The "format=2" warning generates too many warnings about valid
- # usage in the library.
- #CXXFLAGS="$CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
-
- # Append more extra warning flags that only gcc3.3+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wendif-labels"
- ;;
-
- g++-3.2*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append warning flags from gcc-3* case
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
-
- # Append more extra warning flags that only gcc3.2+ know about
- H5_CXXFLAGS="$H5_CXXFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
-
- # The "format=2" warning generates too many warnings about valid
- # usage in the library.
- #CXXFLAGS="$CXXFLAGS -Wformat=2"
-
- # The "unreachable code" flag generates many spurious C++ warnings.
- # We'll disable it for now.
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wunreachable-code"
- ;;
-
- g++-3*)
- # Disable warnings about using 'long long' type
- H5_CXXFLAGS="$H5_CXXFLAGS -Wno-long-long"
-
- # Append some extra warning flags that only gcc3+ know about
- # (don't use -Wpadded flag for normal builds, many of the warnings its
- # issuing can't be fixed and they are making it hard to detect other,
- # more important warnings)
- #H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
- H5_CXXFLAGS="$H5_CXXFLAGS -Wfloat-equal -Wmissing-format-attribute"
- ;;
-esac
+ -Wopenmp-simd"
# Clear cxx info if no flags set
if test "X$cxx_flags_set" = "X"; then
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)
diff --git a/config/gnu-flags b/config/gnu-flags
index ca0e1b4..c2904fe 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -36,12 +36,12 @@ demote_errors()
}
#
-# Prepend `$srcdir/config/gnu-` to the filename suffix(es) given as
+# 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_gcc_arguments()
+load_gnu_arguments()
{
set -- $(for arg; do
sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors
@@ -49,7 +49,6 @@ load_gcc_arguments()
IFS=' ' echo "$*"
}
-
# Get the compiler version in a way that works for gcc
# unless a compiler version is already known
#
@@ -189,15 +188,15 @@ if test "X-gcc" = "X-$cc_vendor"; then
# General #
###########
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments general)"
- H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-general)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)"
+ H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)"
######################
# Developer warnings #
######################
- NO_DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments no-developer-general)
- DEVELOPER_WARNING_CFLAGS=$(load_gcc_arguments developer-general)
+ NO_DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments no-developer-general)
+ DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments developer-general)
#######################
# gcc 4 special cases #
@@ -205,27 +204,27 @@ if test "X-gcc" = "X-$cc_vendor"; then
# GCC 4.2 through 4.6
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.6)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.6)"
fi
# GCC 4.2 through 4.3
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.3)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.3)"
fi
# GCC 4.5 through 4.6
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.5-4.6)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.5-4.6)"
fi
# GCC 4.2 through 4.4
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -a $cc_vers_major -eq 4 -a $cc_vers_minor -le 4; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.4)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.4)"
fi
# GCC 4.2 through the end of GCC 4 series
if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.2-4.last)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.last)"
fi
#############################
@@ -234,75 +233,75 @@ if test "X-gcc" = "X-$cc_vendor"; then
# gcc >= 4.3
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.3)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.3)"
fi
# gcc >= 4.4
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.4)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.4)"
fi
# gcc >= 4.5
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.5)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.5)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.5)"
NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.5)"
fi
# gcc >= 4.6
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.6)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.6)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.6)"
NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.6)"
fi
# gcc >= 4.7
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.7)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.7)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.7)"
NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.7)"
fi
# gcc >= 4.8
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.8)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.8)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-4.8)"
NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-4.8)"
fi
# gcc >= 4.9
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 9; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 4.9)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.9)"
fi
# gcc >= 5
if test $cc_vers_major -ge 5; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 5)"
- H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-5)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 5)"
+ H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-5)"
fi
# gcc >= 6
if test $cc_vers_major -ge 6; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 6)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 6)"
fi
# gcc >= 7
if test $cc_vers_major -ge 7; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 7)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 7)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-7)"
fi
# gcc 8
if test $cc_vers_major -ge 8; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 8)"
- H5_ECFLAGS="$H5_ECFLAGS $(load_gcc_arguments error-8)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 8)"
+ H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-8)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments developer-8)"
NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gcc_arguments no-developer-8)"
fi
# gcc 9
if test $cc_vers_major -ge 9; then
- H5_CFLAGS="$H5_CFLAGS $(load_gcc_arguments 9)"
+ H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 9)"
fi
#################
@@ -316,3 +315,4 @@ if test "X$cc_flags_set" = "X"; then
cc_vendor=
cc_version=
fi
+
diff --git a/config/gnu-warnings/cxx-general b/config/gnu-warnings/cxx-general
new file mode 100644
index 0000000..7e0655c
--- /dev/null
+++ b/config/gnu-warnings/cxx-general
@@ -0,0 +1,19 @@
+# Note that some of the flags listed here really should be developer
+# flags (listed in separate files, gnu-warnings-developer*) but we put
+# them here because they are not raised by the current code and we'd like to
+# know if they do start showing up.
+#
+# NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
+# warnings that are emitted. If you need it, add it from the
+# environment variable at configure time.
+-Wabi
+-Wctor-dtor-privacy
+-Weffc++
+##-Wendif-labels"
+-Wnon-virtual-dtor
+-Wold-style-cast
+-Woverloaded-virtual
+-Wreorder
+-Wsign-promo
+##-Wunreachable-code"
+##-Wvariadic-macros -
diff --git a/config/gnu-warnings/gfort-4.4 b/config/gnu-warnings/gfort-4.4
new file mode 100644
index 0000000..59fe9a2
--- /dev/null
+++ b/config/gnu-warnings/gfort-4.4
@@ -0,0 +1,2 @@
+-Warray-temporaries
+-Wintrinsics-std \ No newline at end of file
diff --git a/config/gnu-warnings/gfort-4.5 b/config/gnu-warnings/gfort-4.5
new file mode 100644
index 0000000..55ae1d7
--- /dev/null
+++ b/config/gnu-warnings/gfort-4.5
@@ -0,0 +1 @@
+-Wimplicit-procedure \ No newline at end of file
diff --git a/config/gnu-warnings/gfort-4.7 b/config/gnu-warnings/gfort-4.7
new file mode 100644
index 0000000..a7532bb
--- /dev/null
+++ b/config/gnu-warnings/gfort-4.7
@@ -0,0 +1,2 @@
+-Wreal-q-constant
+-Wfunction-elimination
diff --git a/config/gnu-warnings/gfort-4.8 b/config/gnu-warnings/gfort-4.8
new file mode 100644
index 0000000..1fddee0
--- /dev/null
+++ b/config/gnu-warnings/gfort-4.8
@@ -0,0 +1,5 @@
+-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.
+-Wno-c-binding-type"
diff --git a/config/gnu-warnings/gfort-5 b/config/gnu-warnings/gfort-5
new file mode 100644
index 0000000..c5d3850
--- /dev/null
+++ b/config/gnu-warnings/gfort-5
@@ -0,0 +1 @@
+-Wuse-without-only
diff --git a/config/gnu-warnings/gfort-6 b/config/gnu-warnings/gfort-6
new file mode 100644
index 0000000..f70466c
--- /dev/null
+++ b/config/gnu-warnings/gfort-6
@@ -0,0 +1 @@
+-Winteger-division
diff --git a/config/gnu-warnings/gfort-8 b/config/gnu-warnings/gfort-8
new file mode 100644
index 0000000..5097365
--- /dev/null
+++ b/config/gnu-warnings/gfort-8
@@ -0,0 +1 @@
+-Wfrontend-loop-interchange
diff --git a/config/gnu-warnings/gfort-general b/config/gnu-warnings/gfort-general
new file mode 100644
index 0000000..4028316
--- /dev/null
+++ b/config/gnu-warnings/gfort-general
@@ -0,0 +1,12 @@
+# Note that some of the flags listed here really should be developer
+# flags (listed in separate files, gnu-warnings-developer*) but we put
+# them here because they are not raised by the current code and we'd like to
+# know if they do start showing up.
+-Waliasing
+-Wall
+-Wcharacter-truncation
+-Wextra
+-Wimplicit-interface
+-Wsurprising
+-Wunderflow
+-pedantic
diff --git a/config/intel-ifort-general b/config/intel-ifort-general
new file mode 100644
index 0000000..a9da0e5
--- /dev/null
+++ b/config/intel-ifort-general
@@ -0,0 +1 @@
+-warn:all
diff --git a/config/intel-warnings-general b/config/intel-warnings-general
index f4ed24c..d0b2e25 100644
--- a/config/intel-warnings-general
+++ b/config/intel-warnings-general
@@ -1,10 +1,2 @@
-# Note that some of the flags listed here really should be developer
-# flags (listed in separate files, gnu-warnings-developer*) but we put
-# them here because they are not raised by the current code and we'd like to
-# know if they do start showing up.
-#
-# NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
-# warnings that are emitted. If you need it, add it from the
-# environment variable at configure time.
-Wall
-Wcheck \ No newline at end of file