summaryrefslogtreecommitdiffstats
path: root/src/H5.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2009-09-29 04:43:22 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2009-09-29 04:43:22 (GMT)
commit0f2901843cfc32aebd192db176eec07c99a121b7 (patch)
tree0580989402ea662ff55a443b824c04609db7e19f /src/H5.c
parent06a71c86a3079e5acaa175898728a47c6e21e53c (diff)
downloadhdf5-0f2901843cfc32aebd192db176eec07c99a121b7.zip
hdf5-0f2901843cfc32aebd192db176eec07c99a121b7.tar.gz
hdf5-0f2901843cfc32aebd192db176eec07c99a121b7.tar.bz2
[svn-r17543] Bug fix (ID 1656):
Changed H5check_version() to suppress the warning message totally if $HDF5_DISABLE_VERSION_CHECK is 2 or higher. (Old behavior treated 3 or higher the same as 1, that is to print a warning and allows the program to continue. Tested: h5committested, extra jam serial, --disable-embedded-libinfo.
Diffstat (limited to 'src/H5.c')
-rw-r--r--src/H5.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/H5.c b/src/H5.c
index f11e8b7..4041483 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -621,7 +621,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
char lib_str[256];
char substr[] = H5_VERS_SUBRELEASE;
static int checked = 0; /* If we've already checked the version info */
- static int disable_version_check = 0; /* Set if the version check should be disabled */
+ static unsigned int disable_version_check = 0; /* Set if the version check should be disabled */
herr_t ret_value=SUCCEED; /* Return value */
static char *version_mismatch_warning=VERSION_MISMATCH_WARNING;
@@ -638,7 +638,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
s = HDgetenv ("HDF5_DISABLE_VERSION_CHECK");
if (s && HDisdigit(*s))
- disable_version_check = (int)HDstrtol (s, NULL, 0);
+ disable_version_check = (unsigned int)HDstrtol (s, NULL, 0);
}
if (H5_VERS_MAJOR!=majnum || H5_VERS_MINOR!=minnum ||
@@ -648,7 +648,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
HDfprintf(stderr, "%s%s", version_mismatch_warning,
"You can, at your own risk, disable this warning by setting the environment\n"
"variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.\n"
- "Setting it to 2 will suppress the warning messages totally.\n");
+ "Setting it to 2 or higher will suppress the warning messages totally.\n");
/* Mention the versions we are referring to */
HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n",
majnum, minnum, relnum,
@@ -659,12 +659,9 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
/* Bail out now. */
HDfputs ("Bye...\n", stderr);
HDabort ();
- case 2:
- /* continue silently */
- break;
- default:
+ case 1:
/* continue with a warning */
- /* Note that the warning message is embedded in the format string. */
+ /* Note that the warning message is embedded in the format string.*/
HDfprintf (stderr,
"%s'HDF5_DISABLE_VERSION_CHECK' "
"environment variable is set to %d, application will\n"
@@ -677,6 +674,9 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
/* Show library settings if available */
HDfprintf (stderr, "%s", H5libhdf5_settings);
break;
+ default:
+ /* 2 or higer: continue silently */
+ break;
} /* end switch */
} /* end if */