diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/HDFCompilerFlags.cmake | 7 | ||||
-rw-r--r-- | config/cmake/jrunTest.cmake | 2 | ||||
-rw-r--r-- | config/cmake_ext_mod/ConfigureChecks.cmake | 2 | ||||
-rw-r--r-- | config/cmake_ext_mod/FindSZIP.cmake | 2 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFMacros.cmake | 9 | ||||
-rw-r--r-- | config/gnu-flags | 52 |
6 files changed, 61 insertions, 13 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 0a39568..4712f50 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -195,7 +195,12 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) # Append more extra warning flags that only gcc 6.x+ know about if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa") + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized") + endif () + + # Append more extra warning flags that only gcc 7.x+ know about + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) + set (H5_CFLAGS4 "${H5_CFLAGS4} -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wrestrict") endif () endif () diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index fc49275..44ac15b 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# runTest.cmake executes a command and captures the output in a file. File is then compared +# jrunTest.cmake executes a command and captures the output in a file. File is then compared # against a reference file. Exit status of command can also be compared. cmake_policy(SET CMP0007 NEW) diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index bbd5170..63d9ee9 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -28,7 +28,7 @@ if (APPLE) list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) if (ARCH_LENGTH GREATER 1) set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE) - message(FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" + message (FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" "due to technical reasons. The best approach would be build each architecture in separate directories" "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'" "variable has been set to a blank value which will build the default architecture for this system.") diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index 97a2336..152f8ac 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -27,7 +27,7 @@ # Result variables ################### -This module will set the following variables in your project: +# This module will set the following variables in your project: # SZIP_FOUND, true if the SZIP headers and libraries were found. # SZIP_INCLUDE_DIR, the directory containing the SZIP headers. diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index e971224..9da5006 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -28,7 +28,7 @@ macro (SET_HDF_BUILD_TYPE) endif() endif() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") + message (STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" @@ -224,10 +224,9 @@ macro (TARGET_C_PROPERTIES wintarget libtype) $<$<C_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}> $<$<CXX_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}> ) - target_link_libraries(${wintarget} INTERFACE - $<$<C_COMPILER_ID:MSVC>:${WIN_LINK_FLAGS}> - $<$<CXX_COMPILER_ID:MSVC>:${WIN_LINK_FLAGS}> - ) + if(MSVC) + set_property(TARGET ${wintarget} APPEND PROPERTY LINK_FLAGS "${WIN_LINK_FLAGS}") + endif() endmacro () #----------------------------------------------------------------------------- diff --git a/config/gnu-flags b/config/gnu-flags index 7df72c7..c55391d 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -117,7 +117,7 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal" H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith" - H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum" + H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-enum -Wswitch-default" H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings" # Production @@ -187,10 +187,10 @@ esac # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in -# When the gcc 7.x release is out, we should check for additional flags to +# When the gcc 8.x release is out, we should check for additional flags to # include and break it out into it's own section, like the other versions # below. -QAK - gcc-[6789].*) + gcc-[789].*) # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) @@ -227,7 +227,51 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat" # Append warning flags that only gcc 6.x+ knows about - H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa" + H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized" + + # Append warning flags that only gcc 7.x+ knows about + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=2" + H5_CFLAGS="$H5_CFLAGS -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wrestrict" + ;; + + gcc-6*) + # Append warning flags that only gcc 4.2+ knows about + # (none, or incorporated in -Wall / -Wextra now) + + # Append warning flags that only gcc 4.3+ knows about + # + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... -QAK + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" + + # Append warning flags that only gcc 4.4+ knows about + H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" + + # Append warning flags that only gcc 4.5+ knows about + H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" + + # Append warning flags that only gcc 4.6+ knows about + H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" + + # Append warning flags that only gcc 4.7+ knows about + H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" + + # Append warning flags that only gcc 4.8+ knows about + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" + + # Append warning flags that only gcc 4.9+ knows about + H5_CFLAGS="$H5_CFLAGS -Wdate-time" + + # Append warning flags that only gcc 5.x+ knows about + H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat" + + # Append warning flags that only gcc 6.x+ knows about + H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized" ;; gcc-5*) |