diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-04-24 21:25:51 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2020-04-27 16:09:17 (GMT) |
commit | 7491ba03f9a6bc4d45bd50b2de9806d853da81eb (patch) | |
tree | 1eb3e56e77c7e2916ba7a22c00005cbea72335c8 /config | |
parent | 2956151239dba57386b4fc25c659933f42688e4b (diff) | |
download | hdf5-7491ba03f9a6bc4d45bd50b2de9806d853da81eb.zip hdf5-7491ba03f9a6bc4d45bd50b2de9806d853da81eb.tar.gz hdf5-7491ba03f9a6bc4d45bd50b2de9806d853da81eb.tar.bz2 |
Restrict errors to gcc 4.8 and above.
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/HDFCompilerFlags.cmake | 13 | ||||
-rw-r--r-- | config/gnu-flags | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index a40b525..b8eef97 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -114,6 +114,8 @@ if (NOT MSVC) # Add general CFlags except for older versions that are no longer supported if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") + endif () + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") endif () # gcc automatically inlines based on the optimization level @@ -157,6 +159,17 @@ if (NOT MSVC) if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") endif () + + # Append warning flags for gcc 4.2-4.3 + if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.3") + endif () + + # Append warning flags for gcc 4.2-4.4 + if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.4 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.4") + endif () + # Append warning flags that only gcc 4.3+ knows about if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") diff --git a/config/gnu-flags b/config/gnu-flags index f391d7b..7e69ede 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -190,6 +190,8 @@ if test "X-gcc" = "X-$cc_vendor"; then if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -gt 4; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)" + fi + if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8 -o $cc_vers_major -gt 4; then H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)" fi |