summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2020-06-10 20:18:36 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2020-06-10 20:18:36 (GMT)
commita56da14860ef436ee2d8f2aa00766c02889e8b6b (patch)
tree9dd535a4d73249dee7a8be99a1c3978991428e26
parent7f0c0134166275c0745e0e65f9d81b4de72d5ce2 (diff)
parent20eab963899841c9a003baebead8e3bc07d9e127 (diff)
downloadhdf5-a56da14860ef436ee2d8f2aa00766c02889e8b6b.zip
hdf5-a56da14860ef436ee2d8f2aa00766c02889e8b6b.tar.gz
hdf5-a56da14860ef436ee2d8f2aa00766c02889e8b6b.tar.bz2
Merge pull request #2633 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop
* commit '20eab963899841c9a003baebead8e3bc07d9e127': Remove duplicate entries in MANIFEST. Make changes to CMake CompilerFlags.cmake files so extra flags are loaded for non-GNU compilers. Update new clang files to not pick up clang as vendor for pgCC. Add new files to MANIFEST Temporary demotion of 2 -Werror warning flags that fail on macos 10.12 Remove Production flag unknown to Apple clang.
-rw-r--r--config/clang-cxxflags13
-rw-r--r--config/clang-flags13
-rw-r--r--config/clang-warnings/developer-general1
-rw-r--r--config/clang-warnings/error-general5
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake56
-rw-r--r--config/cmake/HDFCompilerFlags.cmake26
6 files changed, 44 insertions, 70 deletions
diff --git a/config/clang-cxxflags b/config/clang-cxxflags
index 9c283cd..188570e 100644
--- a/config/clang-cxxflags
+++ b/config/clang-cxxflags
@@ -64,10 +64,11 @@ if test "X-" = "X-$cxx_flags_set"; then
else
cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 |\
grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`"
- cxx_vendor="Apple LLVM"
+ if test -n "$cxx_version"; then
+ cxx_vendor="Apple LLVM"
+ fi
fi
if test "X-" != "X-$cxx_version"; then
- echo "compiler '$CXX' is $cxx_vendor-$cxx_version"
# Get the compiler version numbers
cxx_vers_major=`echo $cxx_version | cut -f1 -d.`
@@ -131,11 +132,7 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then
##############
# NDEBUG is handled explicitly by the configure script
- if test $cxx_vers_major -le 4; then
- PROD_CXXFLAGS=
- else
- PROD_CXXFLAGS="-fstdarg-opt"
- fi
+ PROD_CXXFLAGS=
#########
# Debug #
@@ -153,7 +150,7 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then
# Symbols #
###########
- NO_SYMBOLS_CXXFLAGS="-s"
+ NO_SYMBOLS_CXXFLAGS=
SYMBOLS_CXXFLAGS="-g -fno-omit-frame-pointer"
#############
diff --git a/config/clang-flags b/config/clang-flags
index e7ade49..18ec5f6 100644
--- a/config/clang-flags
+++ b/config/clang-flags
@@ -64,10 +64,11 @@ if test "X-" = "X-$cc_flags_set"; then
else
cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\
grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`"
- cc_vendor="Apple LLVM"
+ if test -n "$cc_version"; then
+ cc_vendor="Apple LLVM"
+ fi
fi
if test "X-" != "X-$cc_version"; then
- echo "compiler '$CC' is $cc_vendor-$cc_version"
# Get the compiler version numbers
cc_vers_major=`echo $cc_version | cut -f1 -d.`
@@ -131,11 +132,7 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then
##############
# NDEBUG is handled explicitly by the configure script
- if test $cc_vers_major -le 4; then
- PROD_CFLAGS=
- else
- PROD_CFLAGS="-fstdarg-opt"
- fi
+ PROD_CFLAGS=
#########
# Debug #
@@ -153,7 +150,7 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then
# Symbols #
###########
- NO_SYMBOLS_CFLAGS="-s"
+ NO_SYMBOLS_CFLAGS=
SYMBOLS_CFLAGS="-g"
#############
diff --git a/config/clang-warnings/developer-general b/config/clang-warnings/developer-general
index aa8c32e..74d8404 100644
--- a/config/clang-warnings/developer-general
+++ b/config/clang-warnings/developer-general
@@ -1,3 +1,4 @@
-Wformat-nonliteral
-Wmissing-noreturn
+-Wsometimes-uninitialized
-Wswitch-enum
diff --git a/config/clang-warnings/error-general b/config/clang-warnings/error-general
index a9aa516..883dff7 100644
--- a/config/clang-warnings/error-general
+++ b/config/clang-warnings/error-general
@@ -8,10 +8,11 @@
-Werror=missing-declarations
-Werror=packed
-Werror=shadow
--Werror=sometimes-uninitialized
-Werror=switch
#
-#-Werror=discarded-qualifiers
+# NOTE: Following files are not compatible with incompatible-pointer-types as errors
+# src/H5Dchunk.c,src/H5Dint.c,src/H5Gint.c,src/H5HFcache.c,src/H5I.c,src/H5T.c
+-Wno-error=incompatible-pointer-types-discards-qualifiers
#
#
# NOTE: File Driver files are not compatible with these warnings as errors
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake
index 8527327..7bbebbc 100644
--- a/config/cmake/HDFCXXCompilerFlags.cmake
+++ b/config/cmake/HDFCXXCompilerFlags.cmake
@@ -40,7 +40,7 @@ if (HDF5_DISABLE_COMPILER_WARNINGS)
# warning level is given, so remove it.
if (MSVC)
set (HDF5_WARNINGS_BLOCKED 1)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0")
endif ()
@@ -51,7 +51,7 @@ if (HDF5_DISABLE_COMPILER_WARNINGS)
# Most compilers use -w to suppress warnings.
if (NOT HDF5_WARNINGS_BLOCKED)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
endif ()
endif ()
@@ -65,7 +65,7 @@ endif ()
# CDash is configured to only allow 3000 warnings, so
# break into groups (from the config/gnu-flags file)
#-----------------------------------------------------------------------------
-if (NOT MSVC)
+if (NOT MSVC AND NOT MINGW)
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
list (APPEND HDF5_CMAKE_CXX_FLAGS "-erroff=%none -DBSD_COMP")
else ()
@@ -194,7 +194,9 @@ if (NOT MSVC)
endif ()
endif ()
else ()
+ if (NOT MINGW)
list (APPEND HDF5_CMAKE_CXX_FLAGS "/EHsc")
+ endif ()
endif ()
#-----------------------------------------------------------------------------
@@ -204,21 +206,19 @@ if (HDF5_ENABLE_ALL_WARNINGS)
message (STATUS "....All Warnings are enabled")
if (MSVC)
if (HDF5_ENABLE_DEV_WARNINGS)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ 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")
endif ()
else ()
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
endif ()
endif ()
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0} ${H5_CXXFLAGS1} ${H5_CXXFLAGS2} ${H5_CXXFLAGS3} ${H5_CXXFLAGS4})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0} ${H5_CXXFLAGS1} ${H5_CXXFLAGS2} ${H5_CXXFLAGS3} ${H5_CXXFLAGS4})
endif ()
endif ()
endif ()
@@ -229,15 +229,13 @@ endif ()
if (HDF5_ENABLE_GROUPZERO_WARNINGS)
message (STATUS "....Group Zero warnings are enabled")
if (MSVC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ 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_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0})
endif ()
endif ()
endif ()
@@ -248,15 +246,13 @@ endif ()
if (HDF5_ENABLE_GROUPONE_WARNINGS)
message (STATUS "....Group One warnings are enabled")
if (MSVC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ 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_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS1})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS1})
endif ()
endif ()
endif ()
@@ -267,15 +263,13 @@ endif ()
if (HDF5_ENABLE_GROUPTWO_WARNINGS)
message (STATUS "....Group Two warnings are enabled")
if (MSVC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ 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_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS2})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS2})
endif ()
endif ()
endif ()
@@ -286,15 +280,13 @@ endif ()
if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
message (STATUS "....Group Three warnings are enabled")
if (MSVC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ 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_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS3})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS3})
endif ()
endif ()
endif ()
@@ -305,10 +297,8 @@ endif ()
if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
message (STATUS "....Group Four warnings are enabled")
if (NOT MSVC)
- if (CMAKE_COMPILER_IS_GNUCC)
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS4})
- endif ()
+ if (CMAKE_CXX_COMPILER_LOADED)
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS4})
endif ()
endif ()
endif ()
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index cd4ab48..31af2f8 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -68,7 +68,7 @@ endif ()
# CDash is configured to only allow 3000 warnings, so
# break into groups (from the config/gnu-flags file)
#-----------------------------------------------------------------------------
-if (NOT MSVC)
+if (NOT MSVC AND NOT MINGW)
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
list (APPEND HDF5_CMAKE_C_FLAGS "-erroff=%none -DBSD_COMP")
else ()
@@ -209,9 +209,7 @@ if (HDF5_ENABLE_ALL_WARNINGS)
list (APPEND HDF5_CMAKE_C_FLAGS "/W3")
endif ()
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4})
endif ()
endif ()
@@ -225,9 +223,7 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W1")
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0})
endif ()
endif ()
@@ -241,9 +237,7 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W2")
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1})
endif ()
endif ()
@@ -257,9 +251,7 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W3")
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2})
endif ()
endif ()
@@ -273,9 +265,7 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
list (APPEND HDF5_CMAKE_C_FLAGS "/W4")
else ()
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3})
endif ()
endif ()
@@ -286,9 +276,7 @@ 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)
- if (CMAKE_COMPILER_IS_GNUCC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4})
- endif ()
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4})
endif ()
endif ()