diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2009-09-29 16:45:07 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2009-09-29 16:45:07 (GMT) |
commit | 0ead3e88734ad130c3991947a7b51cd1d5c37102 (patch) | |
tree | d3fcc4ee5928ba37e42dc4108c27f67c109914eb /src | |
parent | 0fa14048c2e18025e99ef5a3b038049a873c7fb5 (diff) | |
download | hdf5-0ead3e88734ad130c3991947a7b51cd1d5c37102.zip hdf5-0ead3e88734ad130c3991947a7b51cd1d5c37102.tar.gz hdf5-0ead3e88734ad130c3991947a7b51cd1d5c37102.tar.bz2 |
[svn-r17548] ------------------------------------------------------------------------
r17543 | acheng | 2009-09-28 23:43:22 -0500 (Mon, 28 Sep 2009) | 8 lines
New test: (Bug ID 1656):
Add new tests (tcheck_version, testcheck_version.sh) to verify H5check_version()
does issue warnings and abort accordingly.
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.
Tests:
H5committed tested plus jam serial tested.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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 */ |