diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2020-06-06 19:36:44 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2020-06-06 19:36:44 (GMT) |
commit | de9491e3651350969b2a75c602984a3786656dcb (patch) | |
tree | e05eeec195ede16a5c41b9db9974561fb57b4206 | |
parent | f7bc306c19a3bd8f9a31a78d81a7bb5160bbbaf8 (diff) | |
download | hdf5-de9491e3651350969b2a75c602984a3786656dcb.zip hdf5-de9491e3651350969b2a75c602984a3786656dcb.tar.gz hdf5-de9491e3651350969b2a75c602984a3786656dcb.tar.bz2 |
Add flags from config/clang-warnings/*general files to H5 C and CXX flags for all versions of Clang and Clang++ compilers.
Switched from cut to awk in testcheck_version.sh.in to avoid dependence
on tab vs. " " in version definitions in H5public.h.
-rw-r--r-- | config/clang-cxxflags | 8 | ||||
-rw-r--r-- | config/clang-flags | 8 | ||||
-rw-r--r-- | config/clang-warnings/cxx-error-general | 32 | ||||
-rw-r--r-- | config/clang-warnings/cxx-general | 31 | ||||
-rw-r--r-- | config/linux-gnulibc1 | 1 | ||||
-rw-r--r-- | configure.ac | 26 | ||||
-rw-r--r-- | test/testcheck_version.sh.in | 6 |
7 files changed, 22 insertions, 90 deletions
diff --git a/config/clang-cxxflags b/config/clang-cxxflags index c6b84c4..9c283cd 100644 --- a/config/clang-cxxflags +++ b/config/clang-cxxflags @@ -183,12 +183,8 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then # General # ########### - if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -gt 4; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_clang_arguments general)" - fi -# if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8 -o $cxx_vers_major -gt 4; then -# H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_clang_arguments error-general)" -# fi + H5_CXXFLAGS="$H5_CXXFLAGS $(load_clang_arguments general)" + H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_clang_arguments error-general)" echo "H5_CXXFLAGS: $H5_CXXFLAGS" diff --git a/config/clang-flags b/config/clang-flags index 32c29d4..e7ade49 100644 --- a/config/clang-flags +++ b/config/clang-flags @@ -183,12 +183,8 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then # General # ########### - 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_clang_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_clang_arguments error-general)" -# fi + H5_CFLAGS="$H5_CFLAGS $(load_clang_arguments general)" + H5_ECFLAGS="$H5_ECFLAGS $(load_clang_arguments error-general)" echo "H5_CFLAGS: $H5_CFLAGS" diff --git a/config/clang-warnings/cxx-error-general b/config/clang-warnings/cxx-error-general deleted file mode 100644 index 85cd9a3..0000000 --- a/config/clang-warnings/cxx-error-general +++ /dev/null @@ -1,32 +0,0 @@ -# -# HDF5 code should not trigger the following warnings under any -# circumstances, so ask the compiler to treat them as errors: -# -# NOTE: c++/test files are not compatible with these warnings as errors -# c++/test/tcompound.cpp -# -Werror=cast-align --Wcast-align -# NOTE: c++/src files are not compatible with these warnings as errors -# c++/src/H5Object.cpp -# -Werror=missing-declarations --Wmissing-declarations --Werror=packed --Werror=redundant-decls --Werror=switch -# NOTE: c++/test files are not compatible with these warnings as errors -# c++/test/tattr.cpp -# -Werror=unused-but-set-variable --Wunused-but-set-variable --Werror=unused-function --Werror=unused-variable -# NOTE: c++/src files are not compatible with these warnings as errors -# c++/src/H5Object.cpp,c++/src/H5StrType.cpp,c++/src/H5PredType.cpp -# -Werror=unused-parameter --Wunused-parameter -# -# Other files not compatible -# NOTE: c++/test files are not compatible with these warnings as errors -# c++/test/titerate.cpp,c++/test/tarray.cpp -# -Werror=missing-declarations -# c++/test/titerate.cpp,c++/test/tarray.cpp,c++/test/tlinks.cpp,c++/test/ttypes.cpp,c++/test/dsets.cpp -# -Werror=unused-parameter diff --git a/config/clang-warnings/cxx-general b/config/clang-warnings/cxx-general deleted file mode 100644 index 9548cc0..0000000 --- a/config/clang-warnings/cxx-general +++ /dev/null @@ -1,31 +0,0 @@ -# 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 --Wcast-qual --Wconversion --Wctor-dtor-privacy --Weffc++ --Wextra --Wfloat-equal --Wformat=2 --Winit-self --Winvalid-pch --Wmissing-include-dirs --Wno-format-nonliteral --Wnon-virtual-dtor --Wold-style-cast --Woverloaded-virtual --Wreorder --Wshadow --Wsign-promo -##-Wunreachable-code --Wundef -##-Wvariadic-macros --Wwrite-strings --pedantic diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 1a12006..055b075 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -65,6 +65,7 @@ if test "X-" = "X-$FC"; then FC_BASENAME=mpif90 ;; clang*) + # clang has no fortran compiler. Use gfortran. FC=gfortran FC_BASENAME=gfortran ;; diff --git a/configure.ac b/configure.ac index 50f823e..cf1e463 100644 --- a/configure.ac +++ b/configure.ac @@ -311,16 +311,8 @@ fi if test "X$CC_BASENAME" = "Xclang"; then AC_SUBST([CLANG_SANITIZE_CHECKS]) - ## These are all the packages that use H5*_DEBUG. - ## There is no harm in specifying a package not in this list; - ## you'll just get an unused H5<pkg>_DEBUG symbol. - ## - ## Some packages that define debug checks or output are - ## too specialized or have huge performance hits. These - ## are not listed in the "all" packages list. - ## - ##all_packages="Address" - + # There are several sanitizer tools. At present we are testing + # and describing only -fsanitizer=address with autotools. case "X-$CLANG_SANITIZE_CHECKS" in X-no|X-none) CLANG_SANITIZE_CHECKS=none @@ -332,8 +324,18 @@ if test "X$CC_BASENAME" = "Xclang"; then esac AC_MSG_RESULT([$CLANG_SANITIZE_CHECKS]) - ## Define H5*_DEBUG symbols that control package output - ## NOTE: No sanity checking done here! + # Other tools can be added to the list of checks + # The clang compiler doesn't support some of them; they should be + # checked before adding them to the list in the help message. + # The sanitizers/sanitizers.cmake file lists these options: + # address, memory, memoryWithOrigins, undefined, thread, leak, + # 'address;undefined'. Which and which combinations of these are + # supported varies by compiler version, but unsupported options + # or combinations will result in configure errors reported in config.log. + # Comma separated lists of sanitize options wil be entered intact in + # one -fsanitize=<list> flag. Space separated lists will be entered in + # separate -fsanitize=<item> flags. + # NOTE: No sanity checking done here! if test -n "$CLANG_SANITIZE_LIST"; then H5_CFLAGS="$H5_CFLAGS -fno-omit-frame-pointer" for sanitizer in `echo $CLANG_SANITIZE_LIST`; do diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in index 836170d..0c2c4cd 100644 --- a/test/testcheck_version.sh.in +++ b/test/testcheck_version.sh.in @@ -216,9 +216,9 @@ h5libsettings=../src/libhdf5.settings PURPOSE # Figure out library version numbers from the header file. -h5versmajor=`grep '#define H5_VERS_MAJOR' $srcdir/../src/H5public.h | cut -f2` -h5versminor=`grep '#define H5_VERS_MINOR' $srcdir/../src/H5public.h | cut -f2` -h5versrelease=`grep '#define H5_VERS_RELEASE' $srcdir/../src/H5public.h | cut -f2` +h5versmajor=`grep '#define H5_VERS_MAJOR' $srcdir/../src/H5public.h | awk '{print $3}'` +h5versminor=`grep '#define H5_VERS_MINOR' $srcdir/../src/H5public.h | awk '{print $3}'` +h5versrelease=`grep '#define H5_VERS_RELEASE' $srcdir/../src/H5public.h | awk '{print $3}'` DEBUGPRINT $h5versmajor.$h5versminor.$h5versrelease case "$h5versmajor$h5versminor$h5versrelease" in [0-9]*) # good. noop. |