summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-07-30 01:18:37 (GMT)
committerGitHub <noreply@github.com>2021-07-30 01:18:37 (GMT)
commit9fd356e2408b6f91bfbe6820cdb979b6fade3fb3 (patch)
treee7eb22fc507cdd6013659ab143444cb4ebd03436 /src
parent9bb1d6d78e305e73b5c882e8f5b3ef66a1acdf8d (diff)
downloadhdf5-9fd356e2408b6f91bfbe6820cdb979b6fade3fb3.zip
hdf5-9fd356e2408b6f91bfbe6820cdb979b6fade3fb3.tar.gz
hdf5-9fd356e2408b6f91bfbe6820cdb979b6fade3fb3.tar.bz2
Added int variable for comparison with H5_VERS_RELEASE in H5.c to avoid (#866)
warning that unsigned comparison < 0 is always false, which is known, but for later versions the comparison can possibly be true.
Diffstat (limited to 'src')
-rw-r--r--src/H5.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/H5.c b/src/H5.c
index 12d226c..2debc92 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -912,6 +912,8 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
static unsigned int disable_version_check = 0; /* Set if the version check should be disabled */
static const char * version_mismatch_warning = VERSION_MISMATCH_WARNING;
herr_t ret_value = SUCCEED; /* Return value */
+ int releasenum = relnum; /* To avoid warning for unsigned < 0
+ comparison in first release versions */
FUNC_ENTER_API_NOINIT_NOERR_NOFS
H5TRACE3("e", "IuIuIu", majnum, minnum, relnum);
@@ -931,7 +933,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
}
/* H5_VERS_MAJOR and H5_VERS_MINOR must match */
- if (H5_VERS_MAJOR != majnum || H5_VERS_MINOR != minnum || H5_VERS_RELEASE > relnum) {
+ if (H5_VERS_MAJOR != majnum || H5_VERS_MINOR != minnum || H5_VERS_RELEASE > releasenum) {
switch (disable_version_check) {
case 0:
HDfprintf(stderr, "%s%s", version_mismatch_warning,