summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2024-03-10 19:42:16 (GMT)
committerGitHub <noreply@github.com>2024-03-10 19:42:16 (GMT)
commitf0ba8baa0d21197df828f3054840755a45105ac0 (patch)
tree2e9e98644e95f2be61208a3fb72171a10ad7dabf /src
parentef401a5f5edf2fc689334a485a6c2ec3f53ecb85 (diff)
downloadhdf5-f0ba8baa0d21197df828f3054840755a45105ac0.zip
hdf5-f0ba8baa0d21197df828f3054840755a45105ac0.tar.gz
hdf5-f0ba8baa0d21197df828f3054840755a45105ac0.tar.bz2
Minimize use of abort() (#4110)
The abort() call is used at several places where it probably shouldn't.
Diffstat (limited to 'src')
-rw-r--r--src/H5.c32
-rw-r--r--src/H5Tbit.c3
-rw-r--r--src/H5private.h8
3 files changed, 19 insertions, 24 deletions
diff --git a/src/H5.c b/src/H5.c
index 8bce0b0..4b0a4a2 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -481,10 +481,10 @@ H5_term_library(void)
fprintf(stderr, "HDF5: infinite loop closing library\n");
fprintf(stderr, " %s\n", loop);
#ifndef NDEBUG
- HDabort();
-#endif /* NDEBUG */
- } /* end if */
- } /* end if */
+ abort();
+#endif
+ }
+ }
}
/* Free open debugging streams */
@@ -831,18 +831,18 @@ done:
/*-------------------------------------------------------------------------
* Function: H5check_version
*
- * Purpose: Verifies that the arguments match the version numbers
- * compiled into the library. This function is intended to be
- * called from user to verify that the versions of header files
- * compiled into the application match the version of the hdf5
- * library.
- * Within major.minor.release version, the expectation
- * is that all release versions are compatible, exceptions to
- * this rule must be added to the VERS_RELEASE_EXCEPTIONS list.
+ * Purpose: Verifies that the arguments match the version numbers
+ * compiled into the library. This function is intended to be
+ * called from user to verify that the versions of header files
+ * compiled into the application match the version of the hdf5
+ * library.
*
- * Return: Success: SUCCEED
+ * Within major.minor.release version, the expectation
+ * is that all release versions are compatible, exceptions to
+ * this rule must be added to the VERS_RELEASE_EXCEPTIONS list.
*
- * Failure: abort()
+ * Return: Success: SUCCEED
+ * Failure: abort()
*
*-------------------------------------------------------------------------
*/
@@ -909,7 +909,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
/* Bail out now. */
fputs("Bye...\n", stderr);
- HDabort();
+ abort();
case 1:
/* continue with a warning */
/* Note that the warning message is embedded in the format string.*/
@@ -949,7 +949,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
/* Bail out now. */
fputs("Bye...\n", stderr);
- HDabort();
+ abort();
case 1:
/* continue with a warning */
/* Note that the warning message is embedded in the format string.*/
diff --git a/src/H5Tbit.c b/src/H5Tbit.c
index dd852a6..f70b038 100644
--- a/src/H5Tbit.c
+++ b/src/H5Tbit.c
@@ -305,7 +305,8 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val)
case H5T_ORDER_NONE:
case H5T_ORDER_MIXED:
default:
- HDabort();
+ /* This function can't return errors */
+ assert(0 && "unknown byte order");
}
H5T__bit_copy(buf, offset, (uint8_t *)&val, (size_t)0, size);
diff --git a/src/H5private.h b/src/H5private.h
index 5663c00..8cc5218 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -612,14 +612,8 @@ typedef off_t h5_stat_size_t;
#define HDoff_t off_t
#endif
-/* Redefine all the POSIX and C functions. We should never see an
- * undecorated POSIX or C function (or any other non-HDF5 function)
- * in the source.
- */
+/* Redefinions of some POSIX and C functions (mainly to deal with Windows) */
-#ifndef HDabort
-#define HDabort() abort()
-#endif
#ifndef HDaccess
#define HDaccess(F, M) access(F, M)
#endif