From e065164883d092b26b48058ad2612e30942d2823 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Sat, 15 Apr 2006 20:33:06 -0500 Subject: [svn-r12261] Purpose: Improvement Description: Modified the warning messages from the Version mismatch checking to suggest the users to try recompiling or checking the shared lib setting. Platforms tested: Tested in heping only since it was just a simple text string changes. (I did moved the strings around a bit.) --- src/H5.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/H5.c b/src/H5.c index 0d15029..77ab302 100644 --- a/src/H5.c +++ b/src/H5.c @@ -566,6 +566,14 @@ done: * *------------------------------------------------------------------------- */ +#define VERSION_MISMATCH_WARNING \ + "Warning! ***HDF5 library version mismatched error***\n" \ + "The HDF5 header files used to compile this application do not match\n" \ + "the version used by the HDF5 library to which this application is linked.\n" \ + "Data corruption or segmentation faults may occur if the application continues.\n" \ + "You should recompile the application or check your shared library related\n" \ + "settings such as 'LD_LIBRARY_PATH'.\n" + herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) { @@ -595,14 +603,10 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) H5_VERS_RELEASE!=relnum) { switch (disable_version_check) { case 0: - HDfputs ("Warning! The HDF5 header files included by this application " - "do not match the\nversion used by the HDF5 library to which " - "this application is linked. Data\ncorruption or " - "segmentation faults may occur if the application " - "is\nallowed to continue. You can, at your own risk, " - "disable this check by setting\nthe environment variable " - "'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.\n" - "Setting it to 2 will suppress the warning totally.\n", + HDfputs (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", stderr); /* Mention the versions we are referring to */ HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", @@ -617,13 +621,10 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) break; default: /* continue with a warning */ - HDfputs ("Warning! The HDF5 header files included by this application " - "do not match the\nversion used by the HDF5 library to which " - "this application is linked. Data\ncorruption or " - "segmentation faults may occur if the application " - "continues.\n'HDF5_DISABLE_VERSION_CHECK' " - "environment variable set, application will\n" - "continue.\n", stderr); + HDfprintf (stderr, VERSION_MISMATCH_WARNING + "'HDF5_DISABLE_VERSION_CHECK' " + "environment variable is set to %d, application will\n" + "continue at your own risk.\n", disable_version_check); /* Mention the versions we are referring to */ HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", majnum, minnum, relnum, -- cgit v0.12