summaryrefslogtreecommitdiffstats
path: root/config/cmake
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-04-06 19:20:07 (GMT)
committerGitHub <noreply@github.com>2021-04-06 19:20:07 (GMT)
commit30861588e0bd10aad25fd8a1eb249ec2ac3944d5 (patch)
tree910ae47e92fce1572b0085f4e48623b3f658d5a3 /config/cmake
parenta2b6c477267ac97dbe077e722b7bb8ba2e2c8dfa (diff)
downloadhdf5-30861588e0bd10aad25fd8a1eb249ec2ac3944d5.zip
hdf5-30861588e0bd10aad25fd8a1eb249ec2ac3944d5.tar.gz
hdf5-30861588e0bd10aad25fd8a1eb249ec2ac3944d5.tar.bz2
Hdf5 merge issue 537 v110 (#545)
* close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake * Modify temporary rpath for testing in java example scripts. (#230) * Fix undefined left shifting of negative numbers (#338) Undefined Bahavior Sanitizer errored here about left shifting negative numbers. * Update license url (#332) * Modify temporary rpath for testing in java example scripts. * Update URL in source file Copyright headers for web copy of COPYING file - src and test directories. * Cleans up a couple of MSVC warnings in testhdf5 (#475) * Fixes a few testhdf5 warnings raised in Visual Studio Visual Studio is grumpier about treating pointers like integers than gcc. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix typos and grammar errors. (#476) * Suppresses the tcheck_version test's abort dialog on Windows (#477) * Suppresses the tcheck_version test's abort dialog on Windows Windows raises a modal abort/retry/ignore dialog box when CRT calls abort(). This change installs a report hook that suppresses the dialog so that the CMake tests don't time out waiting for a nonexistent user to click a dialog box. * Committing clang-format changes * Removes __cdecl from callback Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * More warning fixes (#400) * Fixed -Wunused-local-typedef warning * Fixed -Wformat warnings In one case also removed a `z` character. There was a `z%d` that I think was supposed to be `%zd` * Fixed -Wshorten-64-to-32 warnings * Fixed -Wself-assign warnings * Fixed -Wreserved-id-macro warnings * Commit format changes from clang-format, clang version 10.0.1. * Fixed -Wself-assign warnings * Fixed -Wunused-local-typedef warning * Fixed -Wformat warnings In two cases also removed a `z` character. There was a `z%d` that was supposed to be `%zd`. * Fixed -Wshorten-64-to-32 warnings * Fixed -Wreserved-id-macro warnings * Fixed -Wself-assign warnings * Format source. * Remove blank lines to pass format check. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Changes found during merge to 1.12 (#414) * OESS-98 convert plugin option to FetchContent, add tests * Fixes for pkcfg files because of plugin option * OESS-98 fix tools test for plugins * Keep doxygen comments under 100 chars long - format hint * Whitespace * HDFFV-11144 - Reclassify CMake messages * HDFFV-11099/11100 added help text * Reworked switch statement to compare string instead * Fix typo * Update CDash mode * Correct name of threadsafe * Correct option name * Undo accidental commit * Note LLVM 10 to 11 format default changes * Update format plugin * Undo clang-format version 11 changes * One more correction * Update supported platforms * Revert whitespace changes * Correct whitespace * Changes from PR#3 * HDFFV-11213 added option to control gcc10 warnings diagnostics * HDFFV-11212 Use the new references correctly in JNI utility and tests * format source * Fix typo * Add new test file * HDFFV-11212 - update test and remove unused arg * Minor non-space formatting changes * Use H5I_INVALID_ID instead of "-1" * source formatting * add missing testfile, update jni function * Undo commit of debug code * remove mislocated file * Fix h5repack test for handling of fapls and id close * Update h5diff test files usage text * HDFFV-11212 add new ref tests for JNI export dataset * src format update * Remove blank line typo * src format typo * long double requires %Lg * Another long double foramt specifer S.B. %Lg * issue with t128bit test * Windows issue with h5dump and type. * Fix review issues * refactor function nesting and fix error checks * format fixes * Remove untested functions and javadoc quiet comments * Restore TRY block. * Change string append errors to memory exception * revert to H5_JNI_FATAL_ERROR - support functions need work * Add assertion error for h5util functions * remove duplicate function * format fix * Revert HD function error handling * Update copyright comments * GH #386 java folder copyright corrections * Whitespace * GH #359 implement and fix tools 1.6 API usage * remove excessive comments * Flip inits to correct ifdef section * rework ifdef to be simpler * format issue * Reformat ifdef inits * remove static attribute * format compliance * Update names * Revert because logic relies on float not being int * Changes noticed from creating merge of #412 * Double underscore change * Correct compiler version variable used * Remove header guard underscores * Whitespace cleanup * File locks now work on Windows (#480) * File locks now work on Windows Uses LockFileEx() and UnlockFileEx(). Fixes HDFFV-10191 (partial). * Committing clang-format changes * Committing clang-format changes * Fixes commenting in h5repack * Reworks H5Fis_accessible() H5Fis_accessible() created a new file handle and attempted to read through it, which will fail when a file has been opened with an exclusive lock on operating systems that have mandatory locks. This change uses the same scheme we use in H5Fopen() to check if the file is already open and only tries to read the file signature if the file has not already been opened. Also adds a test for this behavior. * Committing clang-format changes * Trivial change to force github to run actions Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * small edits (#481) * fixed missed closing of a dataset * fixed missed closing of a dataset * fixed typo in error return * Committing clang-format changes * minor edits * code format * Committing clang-format changes * code format * minor edit Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Adds an implementation for nanosleep on Windows (#483) * Adds an implementation for nanosleep on Windows * Committing clang-format changes * Fix insane formatter issue Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Updates HSYS_GOTO_ERROR to emit GetLastError() values on Win32 (#492) * Committing clang-format changes * Updates H5SYS_GOTO_ERROR to emit Win32's GetLastError() * Committing clang-format changes * Format source changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Updates that allow accum SWMR tests to work on Windows (#493) * Committing clang-format changes * Updates the accum test to work on Windows Uses CreateProcess() on Windows * Source formatting * Fix for Unix child result * Fixes process return code bug on Windows Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Disable long double tests and remove CMake flag groups (#494) * OESS-98 convert plugin option to FetchContent, add tests * Fixes for pkcfg files because of plugin option * OESS-98 fix tools test for plugins * Keep doxygen comments under 100 chars long - format hint * Whitespace * HDFFV-11144 - Reclassify CMake messages * HDFFV-11099/11100 added help text * Reworked switch statement to compare string instead * Fix typo * Update CDash mode * Correct name of threadsafe * Correct option name * Undo accidental commit * Note LLVM 10 to 11 format default changes * Update format plugin * Undo clang-format version 11 changes * One more correction * Update supported platforms * Revert whitespace changes * Correct whitespace * Changes from PR#3 * HDFFV-11213 added option to control gcc10 warnings diagnostics * HDFFV-11212 Use the new references correctly in JNI utility and tests * format source * Fix typo * Add new test file * HDFFV-11212 - update test and remove unused arg * Minor non-space formatting changes * Use H5I_INVALID_ID instead of "-1" * source formatting * add missing testfile, update jni function * Undo commit of debug code * remove mislocated file * Fix h5repack test for handling of fapls and id close * Update h5diff test files usage text * HDFFV-11212 add new ref tests for JNI export dataset * src format update * Remove blank line typo * src format typo * long double requires %Lg * Another long double foramt specifer S.B. %Lg * issue with t128bit test * Windows issue with h5dump and type. * Fix review issues * refactor function nesting and fix error checks * format fixes * Remove untested functions and javadoc quiet comments * Restore TRY block. * Change string append errors to memory exception * revert to H5_JNI_FATAL_ERROR - support functions need work * Add assertion error for h5util functions * remove duplicate function * format fix * Revert HD function error handling * Update copyright comments * GH #386 java folder copyright corrections * Whitespace * GH #359 implement and fix tools 1.6 API usage * remove excessive comments * Flip inits to correct ifdef section * rework ifdef to be simpler * format issue * Reformat ifdef inits * remove static attribute * format compliance * Update names * Revert because logic relies on float not being int * Changes noticed from creating merge of #412 * Double underscore change * Correct compiler version variable used * Remove header guard underscores * Whitespace cleanup * Split format source and commit changes on repo push * remove pre-split setting * Change windows TS to use older VS. * correct window os name * HDFFV-11212 JNI export util and Javadoc * Suggested review changes * Another change found * Committing clang-format changes * HDFFV-11113 long double in tools * HDFFV-11113 add note * Disable long double tests for now * HDFFV-11228 remove arbitrary CMake warning groups. * Make each flag a string Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Misc warning fixes (#495) * Committing clang-format changes * Misc warning fixes from Visual Studio * Committing clang-format changes * Fixes warnings in swmr.c test * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Correct merge errors. * Committing clang-format changes Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Sean McBride <sean@rogue-research.com> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org>
Diffstat (limited to 'config/cmake')
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake140
-rw-r--r--config/cmake/HDFCompilerFlags.cmake156
2 files changed, 82 insertions, 214 deletions
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake
index 12dec20..757692c 100644
--- a/config/cmake/HDFCXXCompilerFlags.cmake
+++ b/config/cmake/HDFCXXCompilerFlags.cmake
@@ -91,8 +91,8 @@ if (NOT MSVC AND NOT MINGW)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general")
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
- list (APPEND H5_CXXFLAGS0 "-Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow")
- list (APPEND H5_CXXFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings")
+ list (APPEND H5_CXXFLAGS "-Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow")
+ list (APPEND H5_CXXFLAGS "-Wsign-compare -Wtrigraphs -Wwrite-strings")
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED
@@ -100,9 +100,9 @@ if (NOT MSVC AND NOT MINGW)
# add the general CXX flags for g++ compiler versions 4.8 and above.
ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general")
if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general")
else ()
- ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-general")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-general")
endif ()
endif ()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
@@ -122,20 +122,20 @@ if (NOT MSVC AND NOT MINGW)
if (HDF5_ENABLE_DEV_WARNINGS)
message (STATUS "....HDF5 developer group warnings are enabled")
# if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- # list (APPEND H5_CXXFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing")
+ # list (APPEND H5_CXXFLAGS "-Winline -Wreorder -Wport -Wstrict-aliasing")
# elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
# elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
+ # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
endif ()
else ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
# elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
+ # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
endif ()
endif ()
@@ -144,41 +144,41 @@ if (NOT MSVC AND NOT MINGW)
# we should approach them a bit cautiously... Only needed for gcc 4.X
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last")
endif ()
# Append more extra warning flags that only gcc 4.8+ know about
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8")
if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
else ()
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8")
endif ()
endif ()
# Append more extra warning flags that only gcc 4.9+ know about
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9")
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.9")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.9")
endif ()
# Append more extra warning flags that only gcc 5.1+ know about
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-5")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-5")
if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5")
else ()
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-5")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-5")
endif ()
endif ()
# Append more extra warning flags that only gcc 6.x+ know about
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/6")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/6")
endif ()
# Append more extra warning flags that only gcc 7.x+ know about
@@ -187,34 +187,34 @@ if (NOT MSVC AND NOT MINGW)
ADD_H5_FLAGS (H5_CXxFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7")
if (HDF5_ENABLE_DEV_WARNINGS)
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7")
#else ()
- # ADD_H5_FLAGS (H5_CXXFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7")
+ # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7")
endif ()
endif ()
# Append more extra warning flags that only gcc 8.x+ know about
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/8")
#if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- # ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
+ # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
#else ()
- # ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-8")
+ # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-8")
#endif ()
if (HDF5_ENABLE_DEV_WARNINGS)
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8")
else ()
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8")
endif ()
endif ()
# Append more extra warning flags that only gcc 9.x+ know about
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS4 "${HDF5_SOURCE_DIR}/config/gnu-warnings/9")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9")
endif ()
endif ()
else ()
@@ -232,97 +232,17 @@ if (HDF5_ENABLE_ALL_WARNINGS)
if (HDF5_ENABLE_DEV_WARNINGS)
if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall /wd4668")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall" "/wd4668")
endif ()
else ()
if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3" "/wd4100" "/wd4706" "/wd4127")
endif ()
endif ()
else ()
if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0} ${H5_CXXFLAGS1} ${H5_CXXFLAGS2} ${H5_CXXFLAGS3} ${H5_CXXFLAGS4})
- endif ()
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_GROUPZERO_WARNINGS)
- message (STATUS "....Group Zero warnings are enabled")
- if (MSVC)
- if (CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W1")
- endif ()
- else ()
- if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0})
- endif ()
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_GROUPONE_WARNINGS)
- message (STATUS "....Group One warnings are enabled")
- if (MSVC)
- if (CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W2")
- endif ()
- else ()
- if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS1})
- endif ()
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_GROUPTWO_WARNINGS)
- message (STATUS "....Group Two warnings are enabled")
- if (MSVC)
- if (CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
- endif ()
- else ()
- if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS2})
- endif ()
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
- message (STATUS "....Group Three warnings are enabled")
- if (MSVC)
- if (CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W4")
- endif ()
- else ()
- if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS3})
- endif ()
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
- message (STATUS "....Group Four warnings are enabled")
- if (NOT MSVC)
- if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS4})
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS})
endif ()
endif ()
endif ()
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index bce906d..add40bb 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -15,6 +15,7 @@ set(CMAKE_C_STANDARD_REQUIRED TRUE)
set (CMAKE_C_FLAGS "${CMAKE_C99_STANDARD_COMPILE_OPTION} ${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_SANITIZER_FLAGS} ${CMAKE_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}")
+
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Warnings Configuration: default: ${CMAKE_C_FLAGS} : ${CMAKE_CXX_FLAGS}")
endif ()
@@ -111,34 +112,34 @@ if (NOT MSVC AND NOT MINGW)
# warnings that are emitted. If you need it, add it at configure time.
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general")
- list (APPEND H5_CFLAGS0 "-Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith")
- list (APPEND H5_CFLAGS0 "-Wreturn-type -Wstrict-prototypes -Wuninitialized")
- list (APPEND H5_CFLAGS0 "-Wunknown-pragmas -Wunused-function -Wunused-variable")
+ list (APPEND H5_CFLAGS "-Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith")
+ list (APPEND H5_CFLAGS "-Wreturn-type -Wstrict-prototypes -Wuninitialized")
+ list (APPEND H5_CFLAGS "-Wunknown-pragmas -Wunused-function -Wunused-variable")
# this is just a failsafe
- list (APPEND H5_CFLAGS0 "-finline-functions")
+ list (APPEND H5_CFLAGS "-finline-functions")
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0)
- list (APPEND H5_CFLAGS0 "-Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow")
- list (APPEND H5_CFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings")
+ list (APPEND H5_CFLAGS "-Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow")
+ list (APPEND H5_CFLAGS "-Wsign-compare -Wtrigraphs -Wwrite-strings")
endif()
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
# Add general CFlags for GCC versions 4.8 and above
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general")
if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general")
else ()
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-general")
endif ()
endif ()
# gcc automatically inlines based on the optimization level
# this is just a failsafe
- list (APPEND H5_CFLAGS0 "-finline-functions")
+ list (APPEND H5_CFLAGS "-finline-functions")
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general")
if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general")
else ()
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/noerror-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/noerror-general")
endif ()
elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI")
list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform")
@@ -156,17 +157,17 @@ if (NOT MSVC AND NOT MINGW)
if (HDF5_ENABLE_DEV_WARNINGS)
message (STATUS "....HDF5 developer group warnings are enabled")
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
- list (APPEND H5_CFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing")
+ list (APPEND H5_CFLAGS "-Winline -Wreorder -Wport -Wstrict-aliasing")
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
endif ()
else ()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
endif ()
endif ()
@@ -174,65 +175,79 @@ if (NOT MSVC AND NOT MINGW)
# Technically, variable-length arrays are part of the C99 standard, but
# we should approach them a bit cautiously... Only needed for gcc 4.X
if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last")
endif ()
# Append more extra warning flags that only gcc 4.8+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8")
if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
else ()
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8")
endif ()
endif ()
# Append more extra warning flags that only gcc 4.9+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9")
endif ()
# Append more extra warning flags that only gcc 5.x+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/5")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/5")
if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
else ()
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
endif ()
endif ()
# Append more extra warning flags that only gcc 6.x+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/6")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/6")
endif ()
# Append more extra warning flags that only gcc 7.x+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0)
- ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/7")
if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7")
#else ()
- # ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7")
+ # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7")
endif ()
endif ()
# Append more extra warning flags that only gcc 8.x+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0)
- ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/8")
if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
endif ()
if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8")
else ()
- ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8")
endif ()
endif ()
# Append more extra warning flags that only gcc 9.x+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0)
- ADD_H5_FLAGS (H5_CFLAGS4 "${HDF5_SOURCE_DIR}/config/gnu-warnings/9")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9")
+ endif ()
+
+ # Append more extra warning flags that only gcc 9.3+ know about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.3)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9.3")
+ endif ()
+
+ # Append more extra warning flags that only gcc 10.x+ know about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0)
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-10")
+ #else ()
+ # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-10")
+ endif ()
endif ()
endif ()
endif ()
@@ -240,86 +255,19 @@ endif ()
#-----------------------------------------------------------------------------
# Option to allow the user to enable all warnings
#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF)
+option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" ON)
if (HDF5_ENABLE_ALL_WARNINGS)
message (STATUS "....All Warnings are enabled")
if (MSVC)
if (HDF5_ENABLE_DEV_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/Wall /wd4668")
+ list (APPEND HDF5_CMAKE_C_FLAGS "/Wall" "/wd4668")
else ()
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/W3")
+ list (APPEND HDF5_CMAKE_C_FLAGS "/W3" "/wd4100" "/wd4706" "/wd4127")
endif ()
else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4})
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF)
-if (HDF5_ENABLE_GROUPZERO_WARNINGS)
- message (STATUS "....Group Zero warnings are enabled")
- if (MSVC)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/W1")
- else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0})
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF)
-if (HDF5_ENABLE_GROUPONE_WARNINGS)
- message (STATUS "....Group One warnings are enabled")
- if (MSVC)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/W2")
- else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1})
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF)
-if (HDF5_ENABLE_GROUPTWO_WARNINGS)
- message (STATUS "....Group Two warnings are enabled")
- if (MSVC)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/W3")
- else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2})
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF)
-if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
- message (STATUS "....Group Three warnings are enabled")
- if (MSVC)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/W4")
- else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3})
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-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})
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS})
endif ()
endif ()