summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-05-08 02:45:30 (GMT)
committerGitHub <noreply@github.com>2022-05-08 02:45:30 (GMT)
commit3dd97b88e9f28dc38e1be413be0b80c6b805dd76 (patch)
tree9953716b89be451b6c15b2f4fd978096632d5b6a
parent8287d93f4e5cbc8dfed2ec9e552f71d18ad35174 (diff)
downloadhdf5-3dd97b88e9f28dc38e1be413be0b80c6b805dd76.zip
hdf5-3dd97b88e9f28dc38e1be413be0b80c6b805dd76.tar.gz
hdf5-3dd97b88e9f28dc38e1be413be0b80c6b805dd76.tar.bz2
Onion VFD: Sync with develop (#1753)
-rwxr-xr-xbin/bbrelease2
-rw-r--r--config/cmake/HDFCompilerFlags.cmake1
-rw-r--r--config/gnu-flags1
-rw-r--r--config/gnu-warnings/71
-rw-r--r--config/gnu-warnings/error-71
-rw-r--r--config/gnu-warnings/error-815
-rw-r--r--config/gnu-warnings/error-general38
-rw-r--r--config/ibm-aix8
-rw-r--r--src/H5FDsec2.c15
-rw-r--r--test/onion.c6
-rw-r--r--test/test_swmr.sh.in109
11 files changed, 77 insertions, 120 deletions
diff --git a/bin/bbrelease b/bin/bbrelease
index 90cb72b..6120e37 100755
--- a/bin/bbrelease
+++ b/bin/bbrelease
@@ -239,7 +239,7 @@ if [ X$revmode = Xyes ]; then
# Copy old version of config/lt_vers.am, since it's hard to
# "undo" changes to it.
cp config/lt_vers.am $tmpdir
- branch=`git branch | grep '*' | awk '{print $NF}'`
+ branch=`git symbolic-ref -q --short HEAD`
revision=`git rev-parse --short HEAD`
# Set version information to m.n.r-r$revision.
# (h5vers does not correctly handle just m.n.r-$today.)
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index eb43b73..61218dc 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -231,6 +231,7 @@ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
# Append more extra warning flags that only gcc 7.x+ knows about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0)
ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/7")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-7")
if (HDF5_ENABLE_DEV_WARNINGS)
ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7")
#else ()
diff --git a/config/gnu-flags b/config/gnu-flags
index fe6626d..e25f59b 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -254,6 +254,7 @@ if test "X-gcc" = "X-$cc_vendor"; then
# gcc >= 7
if test $cc_vers_major -ge 7; then
H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 7)"
+ H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-7)"
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-7)"
fi
diff --git a/config/gnu-warnings/7 b/config/gnu-warnings/7
index 9d5b44d..cb8834a 100644
--- a/config/gnu-warnings/7
+++ b/config/gnu-warnings/7
@@ -3,4 +3,3 @@
-Wduplicated-branches
-Wformat-overflow=2
-Wformat-truncation=1
--Wrestrict
diff --git a/config/gnu-warnings/error-7 b/config/gnu-warnings/error-7
new file mode 100644
index 0000000..8eb9fe4
--- /dev/null
+++ b/config/gnu-warnings/error-7
@@ -0,0 +1 @@
+-Werror=restrict
diff --git a/config/gnu-warnings/error-8 b/config/gnu-warnings/error-8
index cbb25f6..36c1414 100644
--- a/config/gnu-warnings/error-8
+++ b/config/gnu-warnings/error-8
@@ -6,17 +6,4 @@
# in order to detect initializations that occur there. It's possible
# that GCC 8 only performs that analysis at -O3, though.
#
-#
-# NOTE: File Driver files are not compatible with these warnings as errors
-# H5FDlog.c,
-# -Werror=maybe-uninitialized
--Wmaybe-uninitialized
-# NOTE: src/ files are not compatible with these warnings as errors
-# src/H5Shyper.c,src/H5SL.c,src/H5Shyper.c
-# -Werror=maybe-uninitialized
-# NOTE: Test files are not compatible with these warnings as errors
-# test/cache_common.c,
-# -Werror=maybe-uninitialized
-# NOTE: hl/src/ files are not compatible with these warnings as errors
-# hl/src/H5DS.c,
-# -Werror=maybe-uninitialized
+-Werror=maybe-uninitialized
diff --git a/config/gnu-warnings/error-general b/config/gnu-warnings/error-general
index a66d284..73d1dd5 100644
--- a/config/gnu-warnings/error-general
+++ b/config/gnu-warnings/error-general
@@ -3,7 +3,10 @@
# circumstances, so ask the compiler to treat them as errors:
#
-Werror=bad-function-cast
+-Werror=cast-align
+-Werror=format
-Werror=implicit-function-declaration
+-Werror=int-to-pointer-cast
-Werror=missing-declarations
-Werror=missing-prototypes
-Werror=nested-externs
@@ -11,10 +14,11 @@
-Werror=packed
-Werror=pointer-sign
-Werror=pointer-to-int-cast
--Werror=int-to-pointer-cast
-Werror=redundant-decls
-Werror=strict-prototypes
-Werror=switch
+-Werror=unused-but-set-variable
+-Werror=unused-variable
#
#-Werror=discarded-qualifiers
#
@@ -25,43 +29,11 @@
#
-Wunused-function
#
-# H5FDdrvr_module.h
-# -Werror=unused-variable
-#
--Wunused-variable
-#
# H5VLpassthru.c
# -Werror=unused-parameter
#
-Wunused-parameter
#
-#
-#
-# NOTE: Tools files are not compatible with these warnings as errors
-# lib/h5tools.c
-# -Werror=cast-align
-#
--Wcast-align
-#
-# lib/h5diff_array.c
-# -Werror=unused-but-set-variable
-#
--Wunused-but-set-variable
-#
-# lib/h5tools_utils.c
-# -Werror=unused-parameter
-#
-#
-# NOTE: JNI files are not compatible with these warnings as errors
-# jni/h5pDCPLImp.c,jni/nativeData.c,jni/h5util.c,jni/h5rImp.c
-# jni/h5sImp.c,jni/h5tImp.c
-# -Werror=cast-align
-# jni/h5util.c
-# -Werror=format(-overflow)
-#
--Werror=format
-#
-#
#Examples and tests do not use the same set of extensive warning flags as libraries
# Here is a list of tests and examples that have issues with the stricter warnings as error
#
diff --git a/config/ibm-aix b/config/ibm-aix
index b4a558d..f48f9d8 100644
--- a/config/ibm-aix
+++ b/config/ibm-aix
@@ -47,10 +47,10 @@ if test "X-" = "X-$FC"; then
fi
fi
-# While we try to avoid setting FCFLAGS directly for use in compilation, in
-# this case we need the -k flag present for some configure checks. As such,
-# the configure script saves the user's set FCFLAGS before running, and
-# restores them when complete. We must then set up both FCFLAGS and H5_FCFLAGS
+# While we try to avoid setting FCFLAGS directly for use in compilation, in
+# this case we need the -k flag present for some configure checks. As such,
+# the configure script saves the user's set FCFLAGS before running, and
+# restores them when complete. We must then set up both FCFLAGS and H5_FCFLAGS
# to ensure the flag is present for both configure as well as for the build.
if test "X-" = "X-$f9x_flags_set"; then
F9XSUFFIXFLAG="-qsuffix=f=f90"
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index aabee0f..acc705e 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -1075,20 +1075,19 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD__sec2_ctl(H5FD_t H5_ATTR_UNUSED *_file, uint64_t op_code, uint64_t flags,
+H5FD__sec2_ctl(H5FD_t *_file, uint64_t H5_ATTR_UNUSED op_code, uint64_t flags,
const void H5_ATTR_UNUSED *input, void H5_ATTR_UNUSED **output)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER_PACKAGE
- switch (op_code) {
- /* Unknown op code */
- default:
- if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG)
- HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "unknown op_code and fail if unknown flag is set")
- break;
- }
+ /* Sanity checks */
+ HDassert(_file);
+
+ /* No op codes are understood. */
+ if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG)
+ HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "unknown op_code and fail if unknown flag is set")
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/test/onion.c b/test/onion.c
index 7a0c186..f5efcf8 100644
--- a/test/onion.c
+++ b/test/onion.c
@@ -4391,7 +4391,7 @@ test_integration_reference(void)
/* Verify the number of selection */
if ((nelmts = H5Sget_select_npoints(space)) != 8) {
- printf("Number of selected elements is supposed to be 8, but got %lld\n", nelmts);
+ HDprintf("Number of selected elements is supposed to be 8, but got %" PRIuHSIZE "\n", nelmts);
TEST_ERROR;
}
@@ -4534,7 +4534,7 @@ test_integration_reference(void)
TEST_ERROR;
if ((nelmts = H5Sget_select_npoints(space2)) != 8) {
- printf("Number of selected elements is supposed to be 8, but got %lld\n", nelmts);
+ HDprintf("Number of selected elements is supposed to be 8, but got %" PRIuHSIZE "\n", nelmts);
TEST_ERROR;
}
@@ -4547,7 +4547,7 @@ test_integration_reference(void)
TEST_ERROR;
if ((nelmts = H5Sget_select_npoints(space2)) != 4) {
- printf("Number of selected elements is supposed to be 4, but got %lld\n", nelmts);
+ HDprintf("Number of selected elements is supposed to be 4, but got %" PRIuHSIZE "\n", nelmts);
TEST_ERROR;
}
diff --git a/test/test_swmr.sh.in b/test/test_swmr.sh.in
index d61fdbb..e517ddc 100644
--- a/test/test_swmr.sh.in
+++ b/test/test_swmr.sh.in
@@ -1,4 +1,4 @@
-#! /bin/bash
+#!/usr/bin/env bash
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@@ -11,12 +11,10 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-# Tests for the swmr feature.
+# Acceptance tests for the SWMR feature
#
-# Created:
-# Albert Cheng, 2009/07/22
+###############################################################################
-srcdir=@srcdir@
utils_testdir=@abs_top_builddir@/@H5_UTILS_TEST_BUILDDIR@
testdir=@abs_top_builddir@/@H5_TEST_BUILDDIR@
@@ -43,7 +41,7 @@ MESSAGE_TIMEOUT=300 # Message timeout length in secs
# This should be the same as the define in "test/h5test.h"
###############################################################################
-## short hands and function definitions
+## Aliases and function definitions
###############################################################################
DPRINT=: # Set to "echo Debug:" for debugging printing,
# else ":" for noop.
@@ -62,16 +60,16 @@ TESTING() {
# This performs similar function as the routine h5_wait_message() in test/h5test.c
WAIT_MESSAGE() {
message=$1 # Get the name of the message file to wait for
- t0=`date +%s` # Get current time in seconds
+ t0=$(date +%s) # Get current time in seconds
difft=0 # Initialize the time difference
mexist=0 # Indicate whether the message file is found
while [ $difft -lt $MESSAGE_TIMEOUT ] ; # Loop till message times out
do
- t1=`date +%s` # Get current time in seconds
- difft=`expr $t1 - $t0` # Calculate the time difference
- if [ -e $message ]; then # If message file is found:
+ t1=$(date +%s) # Get current time in seconds
+ difft=$(("$t1" - "$t0")) # Calculate the time difference
+ if [ -e "$message" ]; then # If message file is found:
mexist=1 # indicate the message file is found
- rm $message # remove the message file
+ rm "$message" # remove the message file
break # get out of the while loop
fi
done;
@@ -130,7 +128,7 @@ for FILE in swmr*; do
*.o) continue ;; ## don't copy the .o files
esac
if test -f "$FILE" ; then
- cp $FILE swmr_test
+ cp "$FILE" swmr_test
fi
done
@@ -145,12 +143,12 @@ if [ -f .libs/swmr ]; then
*.o) continue ;; ## don't copy the .o files
esac
if test -f "$FILE" ; then
- cp $FILE swmr_test/.libs
+ cp "$FILE" swmr_test/.libs
fi
done
fi
-cd swmr_test
+cd swmr_test || exit 1
# Loop over index types
@@ -173,7 +171,7 @@ do
$testdir/swmr_generator -q $compress $index_type
if test $? -ne 0; then
echo generator had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
# Launch the Generator with SWMR_WRITE
@@ -181,7 +179,7 @@ do
$testdir/swmr_generator -q -s $compress $index_type
if test $? -ne 0; then
echo generator had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
# Check for error and exit if one occurred
@@ -209,7 +207,6 @@ do
# Wait for message from writer process before starting reader(s)
WAIT_MESSAGE $WRITER_MESSAGE
- #
# Launch the Readers
#declare -a seeds=(<seed1> <seed2> <seed3> ... )
echo launch $Nreaders swmr_readers
@@ -220,19 +217,19 @@ do
seed=""
$testdir/swmr_reader -q $Nsecs_add $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
- n=`expr $n + 1`
+ n=$((n + 1))
done
- $DPRINT pid_readers=$pid_readers
+ $DPRINT pid_readers="$pid_readers"
$IFDEBUG ps
- # Collect exit code of the readers first because they usually finish
+ # Collect exit codes of the readers first because they usually finish
# before the writer.
for xpid in $pid_readers; do
- $DPRINT checked reader $xpid
- wait $xpid
+ $DPRINT checked reader "$xpid"
+ wait "$xpid"
if test $? -ne 0; then
echo reader had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
done
@@ -241,7 +238,7 @@ do
wait $pid_writer
if test $? -ne 0; then
echo writer had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
# Check for error and exit if one occurred
@@ -266,7 +263,7 @@ do
$testdir/swmr_generator -q -s $compress $index_type
if test $? -ne 0; then
echo generator had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
# Remove any possible writer message file before launching writer
@@ -281,7 +278,7 @@ do
# Wait for message from writer process before starting reader(s)
WAIT_MESSAGE $WRITER_MESSAGE
- #
+
# Launch the Readers
#declare -a seeds=(<seed1> <seed2> <seed3> ... )
echo launch $Nreaders swmr_readers
@@ -292,19 +289,19 @@ do
seed=""
$testdir/swmr_reader -q $Nsecs_add $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
- n=`expr $n + 1`
+ n=$((n + 1))
done
- $DPRINT pid_readers=$pid_readers
+ $DPRINT pid_readers="$pid_readers"
$IFDEBUG ps
# Collect exit code of the readers first because they usually finish
# before the writer.
for xpid in $pid_readers; do
- $DPRINT checked reader $xpid
- wait $xpid
+ $DPRINT checked reader "$xpid"
+ wait "$xpid"
if test $? -ne 0; then
echo reader had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
done
@@ -313,7 +310,7 @@ do
wait $pid_writer
if test $? -ne 0; then
echo writer had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
# Check for error and exit if one occurred
@@ -344,7 +341,7 @@ do
# Wait for message from writer process before starting reader(s)
WAIT_MESSAGE $WRITER_MESSAGE
- #
+
# Launch the Remove Readers
#declare -a seeds=(<seed1> <seed2> <seed3> ... )
n=0
@@ -355,19 +352,19 @@ do
seed=""
$testdir/swmr_remove_reader -q $Nsecs_rem $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
- n=`expr $n + 1`
+ n=$((n + 1))
done
- $DPRINT pid_readers=$pid_readers
+ $DPRINT pid_readers="$pid_readers"
$IFDEBUG ps
# Collect exit code of the readers first because they usually finish
# before the writer.
for xpid in $pid_readers; do
- $DPRINT checked reader $xpid
- wait $xpid
+ $DPRINT checked reader "$xpid"
+ wait "$xpid"
if test $? -ne 0; then
echo reader had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
done
@@ -376,7 +373,7 @@ do
wait $pid_writer
if test $? -ne 0; then
echo writer had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
# Check for error and exit if one occurred
@@ -401,7 +398,7 @@ do
$testdir/swmr_generator -q $compress $index_type
if test $? -ne 0; then
echo generator had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
# Launch the Writer (not in parallel - just to rebuild the datasets)
@@ -410,7 +407,7 @@ do
$testdir/swmr_writer -q $Nrecords $seed
if test $? -ne 0; then
echo writer had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
# Remove any possible writer message file before launching writer
@@ -436,19 +433,19 @@ do
seed=""
$testdir/swmr_remove_reader -q $Nsecs_addrem $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
- n=`expr $n + 1`
+ n=$((n + 1))
done
- $DPRINT pid_readers=$pid_readers
+ $DPRINT pid_readers="$pid_readers"
$IFDEBUG ps
# Collect exit code of the readers first because they usually finish
# before the writer.
for xpid in $pid_readers; do
- $DPRINT checked reader $xpid
- wait $xpid
+ $DPRINT checked reader "$xpid"
+ wait "$xpid"
if test $? -ne 0; then
echo reader had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
done
@@ -457,7 +454,7 @@ do
wait $pid_writer
if test $? -ne 0; then
echo writer had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
# Check for error and exit if one occurred
@@ -485,7 +482,7 @@ do
$testdir/swmr_generator -q $compress $index_type $seed
if test $? -ne 0; then
echo generator had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
# Remove any possible writer message file before launching writer
@@ -507,26 +504,26 @@ do
# The sparse reader spits out a LOT of data so it's set to 'quiet'
$testdir/swmr_sparse_reader -q $Nrecs_spa 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
- n=`expr $n + 1`
+ n=$((n + 1))
done
- $DPRINT pid_readers=$pid_readers
+ $DPRINT pid_readers="$pid_readers"
$IFDEBUG ps
# Collect exit code of the writer
- $DPRINT checked writer $pid_writer
- wait $pid_writer
+ $DPRINT checked writer "$pid_writer"
+ wait "$pid_writer"
if test $? -ne 0; then
echo writer had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
# Collect exit code of the readers
for xpid in $pid_readers; do
- $DPRINT checked reader $xpid
- wait $xpid
+ $DPRINT checked reader "$xpid"
+ wait "$xpid"
if test $? -ne 0; then
echo reader had error
- nerrors=`expr $nerrors + 1`
+ nerrors=$((nerrors + 1))
fi
done