summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
-rw-r--r--config/cmake/HDFCompilerFlags.cmake6
-rw-r--r--config/gnu-flags2
-rw-r--r--config/gnu-warnings/no-developer-general4
-rw-r--r--src/H5FDdirect.c5
-rw-r--r--src/H5make_libsettings.c32
-rw-r--r--test/swmr_sparse_reader.c4
7 files changed, 35 insertions, 28 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d6e7a2..b559446 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -777,28 +777,28 @@ if (HDF5_ENABLE_THREADSAFE)
endif ()
if (HDF5_ENABLE_PARALLEL)
if (NOT ALLOW_UNSUPPORTED)
- message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ")
+ message (FATAL_ERROR " **** parallel and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ")
else ()
message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ")
endif ()
endif ()
if (HDF5_BUILD_FORTRAN)
if (NOT ALLOW_UNSUPPORTED)
- message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ")
+ message (FATAL_ERROR " **** Fortran and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ")
else ()
message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ")
endif ()
endif ()
if (HDF5_BUILD_CPP_LIB)
if (NOT ALLOW_UNSUPPORTED)
- message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ")
+ message (FATAL_ERROR " **** C++ and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ")
else ()
message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ")
endif ()
endif ()
if (HDF5_BUILD_HL_LIB)
if (NOT ALLOW_UNSUPPORTED)
- message (FATAL_ERROR " **** HL and thread-safety options are not supported **** ")
+ message (FATAL_ERROR " **** HL and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ")
else ()
message (STATUS " **** Allowing unsupported HL and thread-safety options **** ")
endif ()
@@ -1014,7 +1014,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
# check for unsupported options
if (HDF5_ENABLE_PARALLEL)
if (NOT ALLOW_UNSUPPORTED)
- message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ")
+ message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive, override with ALLOW_UNSUPPORTED option **** ")
else ()
message (STATUS " **** Allowing unsupported Parallel and C++ options **** ")
endif ()
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 02bc8b1..6dbaa64 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -96,6 +96,8 @@ if (NOT MSVC)
# Add general CFlags for GCC versions 4.2 and above
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 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
@@ -140,12 +142,12 @@ if (NOT MSVC)
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
+ # 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
+ # 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 ()
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
diff --git a/config/gnu-warnings/no-developer-general b/config/gnu-warnings/no-developer-general
index 85dc0a3..18831dd 100644
--- a/config/gnu-warnings/no-developer-general
+++ b/config/gnu-warnings/no-developer-general
@@ -2,3 +2,7 @@
-Wno-inline
-Wno-missing-format-attribute
-Wno-missing-noreturn
+# NOTE: -pedantic includes -Woverlength-strings which triggers a warning
+# regarding the library settings string (H5libhdf5_settings). We'll turn
+# it off here but leave it on in the developer flags.
+-Wno-overlength-strings
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index d045987..34c4346 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -1335,16 +1335,13 @@ static herr_t
H5FD_direct_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */
- int lock; /* The type of lock */
+ const int lock = rw ? LOCK_EX : LOCK_SH;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
HDassert(file);
- /* Determine the type of lock */
- int lock = rw ? LOCK_EX : LOCK_SH;
-
/* Place the lock with non-blocking */
if(HDflock(file->fd, lock | LOCK_NB) < 0)
HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to flock file")
diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c
index fd67184..72041ed 100644
--- a/src/H5make_libsettings.c
+++ b/src/H5make_libsettings.c
@@ -32,16 +32,15 @@ static const char *FileHeader = "\n\
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <time.h>
#include "H5private.h"
+
/* Do NOT use HDfprintf in this file as it is not linked with the library,
* which contains the H5system.c file in which the function is defined.
*/
#define LIBSETTINGSFNAME "libhdf5.settings"
-FILE *rawoutstream = NULL;
+FILE *rawoutstream = NULL;
/*-------------------------------------------------------------------------
@@ -66,7 +65,7 @@ insert_libhdf5_settings(FILE *flibinfo)
if(NULL == (fsettings = HDfopen(LIBSETTINGSFNAME, "r"))) {
HDperror(LIBSETTINGSFNAME);
HDexit(EXIT_FAILURE);
- } /* end if */
+ }
/* print variable definition and the string */
/* Do not use const else AIX strings does not show it. */
@@ -77,30 +76,31 @@ insert_libhdf5_settings(FILE *flibinfo)
/* Start a new line */
fprintf(flibinfo, "\t\"");
bol = 0;
- } /* end if */
+ }
if(inchar == '\n') {
/* end of a line */
fprintf(flibinfo, "\\n\"\n");
bol++;
- } /* end if */
+ }
else
HDputc(inchar, flibinfo);
- } /* end while */
+ }
+
if(HDfeof(fsettings)) {
/* wrap up */
if(!bol)
/* EOF found without a new line */
fprintf(flibinfo, "\\n\"\n");
fprintf(flibinfo, ";\n\n");
- } /* end if */
+ }
else {
fprintf(stderr, "Read errors encountered with %s\n", LIBSETTINGSFNAME);
HDexit(EXIT_FAILURE);
- } /* end else */
+ }
if(0 != HDfclose(fsettings)) {
HDperror(LIBSETTINGSFNAME);
HDexit(EXIT_FAILURE);
- } /* end if */
+ }
#else
/* print variable definition and an empty string */
/* Do not use const else AIX strings does not show it. */
@@ -170,12 +170,12 @@ information about the library build configuration\n";
n = MIN(sizeof(real_name) - 1, (unsigned)(comma - pwd->pw_gecos));
HDstrncpy(real_name, pwd->pw_gecos, n);
real_name[n] = '\0';
- } /* end if */
+ }
else {
HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
real_name[sizeof(real_name) - 1] = '\0';
- } /* end else */
- } /* end if */
+ }
+ }
else
real_name[0] = '\0';
}
@@ -214,13 +214,15 @@ information about the library build configuration\n";
if(real_name[0])
fprintf(rawoutstream, ">");
HDfputc('\n', rawoutstream);
- } /* end if */
+ }
+
fprintf(rawoutstream, " *\n * Purpose:\t\t");
+
for(s = purpose; *s; s++) {
HDfputc(*s, rawoutstream);
if('\n' == *s && s[1])
fprintf(rawoutstream, " *\t\t\t");
- } /* end for */
+ }
fprintf(rawoutstream, " *\n * Modifications:\n *\n");
fprintf(rawoutstream, " *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n");
diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c
index 6d5d257..2d558df 100644
--- a/test/swmr_sparse_reader.c
+++ b/test/swmr_sparse_reader.c
@@ -115,7 +115,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t
/* Emit informational message */
if(verbose)
- HDfprintf(stderr, "Symbol = '%s', location = %lld\n", symbol->name, (long long)start);
+ HDfprintf(stderr, "Symbol = '%s', location = %" PRIuMAX ",%" PRIuMAX "\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1]);
/* Read record from dataset */
record->rec_id = (uint64_t)ULLONG_MAX;
@@ -126,7 +126,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t
if(record->rec_id != start[1]) {
HDfprintf(stderr, "*** ERROR ***\n");
HDfprintf(stderr, "Incorrect record value!\n");
- HDfprintf(stderr, "Symbol = '%s', location = %lld, record->rec_id = %llu\n", symbol->name, (long long)start, (unsigned long long)record->rec_id);
+ HDfprintf(stderr, "Symbol = '%s', location = %" PRIuMAX ",%" PRIuMAX ", record->rec_id = %" PRIu64 "\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1], record->rec_id);
return -1;
} /* end if */