diff --git a/HDF5Examples/FORTRAN/H5D/h5ex_d_extern.F90 b/HDF5Examples/FORTRAN/H5D/h5ex_d_extern.F90
index e44fdf0c2a9..d8e90103f7f 100644
--- a/HDF5Examples/FORTRAN/H5D/h5ex_d_extern.F90
+++ b/HDF5Examples/FORTRAN/H5D/h5ex_d_extern.F90
@@ -40,8 +40,8 @@ PROGRAM main
   INTEGER :: i, j
   ! This change was introduced in the 1.8.12 release
 #if H5_VERSION_GE(1,8,12)
-  INTEGER(OFF_T) :: offset = 0 ! Offset, in bytes, from the beginning of the file to the 
-                               ! location in the file where the data starts.
+  INTEGER(HADDR_T) :: offset = 0 ! Offset, in bytes, from the beginning of the file to the 
+                                 ! location in the file where the data starts.
 #else
   INTEGER :: offset = 0
 #endif
diff --git a/c++/src/C2Cppfunction_map.htm b/c++/src/C2Cppfunction_map.htm
index 4ea67544efe..deb0d157a0a 100644
--- a/c++/src/C2Cppfunction_map.htm
+++ b/c++/src/C2Cppfunction_map.htm
@@ -16851,7 +16851,7 @@
   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
   mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
   
void DSetCreatPropList::setExternal(const char* name, HDoff_t offset,
+  normal'>void DSetCreatPropList::setExternal(const char* name, haddr_t offset,
   hsize_t size)
   
   void DSetCreatPropList::getExternal(unsigned idx, size_t name_size,
-  char* name, HDoff_t& offset, hsize_t& size)+  char* name, haddr_t& offset, hsize_t& size) | slot[u].offset + (HDoff_t)skip), SEEK_SET) < 0)
+        if (HDlseek(fd, (HDoff_t)(efl->slot[u].offset + skip), SEEK_SET) < 0)
             HGOTO_ERROR(H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file");
 #ifndef NDEBUG
         tempto_read = MIN((size_t)(efl->slot[u].size - skip), (hsize_t)size);
@@ -434,7 +434,7 @@ H5D__efl_write(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t siz
             else
                 HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file");
         } /* end if */
-        if (HDlseek(fd, (HDoff_t)(efl->slot[u].offset + (HDoff_t)skip), SEEK_SET) < 0)
+        if (HDlseek(fd, (HDoff_t)(efl->slot[u].offset + skip), SEEK_SET) < 0)
             HGOTO_ERROR(H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file");
 #ifndef NDEBUG
         tempto_write = MIN(efl->slot[u].size - skip, (hsize_t)size);
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index 9de221120ef..51b3a065b96 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -121,26 +121,36 @@ typedef struct H5FD_stdio_t {
 
 /* Platform-independent names for some file-oriented functions */
 
+/* off_t exists on Windows, but is always a 32-bit long, even on 64-bit Windows,
+ * so on Windows we define my_off_t to be int64_t, which is equivalent to __int64,
+ * the type of the st_size field of the _stati64 struct.
+ */
+#ifdef H5_HAVE_WIN32_API
+typedef int64_t my_off_t;
+#else
+typedef off_t my_off_t;
+#endif
+
 #ifdef H5_HAVE_WIN32_API
 /* Windows and MinGW */
-#define file_ftell _ftelli64
+#define my_ftell _ftelli64
 #else
 /* Everyone else */
-#define file_ftell ftello
+#define my_ftell ftello
 #endif
 
 #if defined(H5_HAVE_WIN32_API) && !defined(H5_HAVE_MINGW)
 /* Windows (but NOT MinGW) */
-#define file_fseek     _fseeki64
-#define file_ftruncate _chsize_s
+#define my_fseek     _fseeki64
+#define my_ftruncate _chsize_s
 #else
 /* Everyone else */
-#define file_fseek     fseeko
-#define file_ftruncate ftruncate
+#define my_fseek     fseeko
+#define my_ftruncate ftruncate
 #endif
 
 /* These macros check for overflow of various quantities.  These macros
- * assume that HDoff_t is signed and haddr_t and size_t are unsigned.
+ * assume that my_off_t is signed and haddr_t and size_t are unsigned.
  *
  * MY_ADDR_OVERFLOW:   Checks whether a file address of type `haddr_t'
  *                     is too large to be represented by the second argument
@@ -153,12 +163,12 @@ typedef struct H5FD_stdio_t {
  *                     which can be addressed entirely by the second
  *                     argument of the file seek function.
  */
-#define MY_MAXADDR          (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1)
+#define MY_MAXADDR          (((haddr_t)1 << (8 * sizeof(my_off_t) - 1)) - 1)
 #define MY_ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MY_MAXADDR))
 #define MY_SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MY_MAXADDR)
 #define MY_REGION_OVERFLOW(A, Z)                                                                             \
     (MY_ADDR_OVERFLOW(A) || MY_SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) ||                               \
-     (HDoff_t)((A) + (Z)) < (HDoff_t)(A))
+     (my_off_t)((A) + (Z)) < (my_off_t)(A))
 
 /* Prototypes */
 static H5FD_t *H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
@@ -310,7 +320,7 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
 #endif /* H5_HAVE_WIN32_API */
 
     /* Sanity check on file offsets */
-    assert(sizeof(HDoff_t) >= sizeof(size_t));
+    assert(sizeof(my_off_t) >= sizeof(size_t));
 
     /* Quiet compiler */
     (void)fapl_id;
@@ -375,11 +385,11 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
     file->op           = H5FD_STDIO_OP_SEEK;
     file->pos          = HADDR_UNDEF;
     file->write_access = write_access; /* Note the write_access for later */
-    if (file_fseek(file->fp, 0, SEEK_END) < 0) {
+    if (my_fseek(file->fp, 0, SEEK_END) < 0) {
         file->op = H5FD_STDIO_OP_UNKNOWN;
     }
     else {
-        HDoff_t x = file_ftell(file->fp);
+        my_off_t x = my_ftell(file->fp);
         assert(x >= 0);
         file->eof = (haddr_t)x;
     }
@@ -765,7 +775,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl
 
     /* Seek to the correct file position. */
     if (!(file->op == H5FD_STDIO_OP_READ || file->op == H5FD_STDIO_OP_SEEK) || file->pos != addr) {
-        if (file_fseek(file->fp, (HDoff_t)addr, SEEK_SET) < 0) {
+        if (my_fseek(file->fp, (my_off_t)addr, SEEK_SET) < 0) {
             file->op  = H5FD_STDIO_OP_UNKNOWN;
             file->pos = HADDR_UNDEF;
             H5Epush_ret(__func__, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1);
@@ -856,7 +866,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp
 
     /* Seek to the correct file position. */
     if ((file->op != H5FD_STDIO_OP_WRITE && file->op != H5FD_STDIO_OP_SEEK) || file->pos != addr) {
-        if (file_fseek(file->fp, (HDoff_t)addr, SEEK_SET) < 0) {
+        if (my_fseek(file->fp, (my_off_t)addr, SEEK_SET) < 0) {
             file->op  = H5FD_STDIO_OP_UNKNOWN;
             file->pos = HADDR_UNDEF;
             H5Epush_ret(__func__, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1);
@@ -1012,7 +1022,7 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, bool /*UNUSED*/ clo
             rewind(file->fp);
 
             /* Truncate file to proper length */
-            if (-1 == file_ftruncate(file->fd, (HDoff_t)file->eoa))
+            if (-1 == my_ftruncate(file->fd, (my_off_t)file->eoa))
                 H5Epush_ret(__func__, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR,
                             "unable to truncate/extend file properly", -1);
 #endif /* H5_HAVE_WIN32_API */
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index ea3c8b2754d..2f913179c2d 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -145,7 +145,7 @@ H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED
 
     for (size_t u = 0; u < mesg->nused; u++) {
 
-        hsize_t offset = 0;
+        haddr_t offset = 0;
 
         /* Name */
         if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_size(f), p_end))
@@ -163,8 +163,8 @@ H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED
         /* File offset */
         if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_size(f), p_end))
             HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding");
-        H5F_DECODE_LENGTH(f, p, offset); /* Decode into an hsize_t to avoid sign warnings */
-        mesg->slot[u].offset = (HDoff_t)offset;
+        H5F_DECODE_LENGTH(f, p, offset);
+        mesg->slot[u].offset = offset;
 
         /* Size */
         if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_size(f), p_end))
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index b50f7c315be..0c3e1470553 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -379,7 +379,7 @@ typedef struct H5O_link_t {
 typedef struct H5O_efl_entry_t {
     size_t  name_offset; /*offset of name within heap	     */
     char   *name;        /*malloc'd name			     */
-    HDoff_t offset;      /*offset of data within file	     */
+    haddr_t offset;      /*offset of data within file	     */
     hsize_t size;        /*size allocated within file	     */
 } H5O_efl_entry_t;
 
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 3186e11c041..78fa4605f50 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -1549,7 +1549,7 @@ H5P__dcrt_ext_file_list_dec(const void **_pp, void *_value)
         enc_size = *(*pp)++;
         assert(enc_size < 256);
         UINT64DECODE_VAR(*pp, enc_value, enc_size);
-        efl->slot[u].offset = (HDoff_t)enc_value;
+        efl->slot[u].offset = enc_value;
 
         /* Decode size */
         enc_size = *(*pp)++;
@@ -2586,7 +2586,7 @@ H5Pget_chunk_opts(hid_t plist_id, unsigned *options /*out*/)
  *-------------------------------------------------------------------------
  */
 herr_t
-H5Pset_external(hid_t plist_id, const char *name, HDoff_t offset, hsize_t size)
+H5Pset_external(hid_t plist_id, const char *name, haddr_t offset, hsize_t size)
 {
     size_t          idx;
     hsize_t         total, tmp;
@@ -2599,8 +2599,6 @@ H5Pset_external(hid_t plist_id, const char *name, HDoff_t offset, hsize_t size)
     /* Check arguments */
     if (!name || !*name)
         HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name given");
-    if (offset < 0)
-        HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "negative external file offset");
 
     /* Get the plist structure */
     if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
@@ -2701,7 +2699,7 @@ H5Pget_external_count(hid_t plist_id)
  *-------------------------------------------------------------------------
  */
 herr_t
-H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name /*out*/, HDoff_t *offset /*out*/,
+H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name /*out*/, haddr_t *offset /*out*/,
                 hsize_t *size /*out*/)
 {
     H5O_efl_t       efl;
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index bdb172bf8dc..a9889a78fd6 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -6044,13 +6044,13 @@ H5_DLL herr_t H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize);
  *          which is a 32-bit signed long value on Windows, which limited
  *          the valid offset that can be returned to 2 GiB.
  *
- * \version 2.0.0 \p offset parameter type changed to HDoff_t from off_t.
+ * \version 2.0.0 \p offset parameter type changed to haddr_t from off_t.
  * \version 1.6.4 \p idx parameter type changed to unsigned.
  * \since 1.0.0
  *
  */
 H5_DLL herr_t H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name /*out*/,
-                              HDoff_t *offset /*out*/, hsize_t *size /*out*/);
+                              haddr_t *offset /*out*/, hsize_t *size /*out*/);
 /**
  * \ingroup DCPL
  *
@@ -6541,11 +6541,11 @@ H5_DLL herr_t H5Pset_dset_no_attrs_hint(hid_t dcpl_id, hbool_t minimize);
  *          which is a 32-bit signed long value on Windows, which limited
  *          the valid offset that can be set to 2 GiB.
  *
- * \version 2.0.0 \p offset parameter type changed to HDoff_t from off_t.
+ * \version 2.0.0 \p offset parameter type changed to haddr_t from off_t.
  * \since 1.0.0
  *
  */
-H5_DLL herr_t H5Pset_external(hid_t plist_id, const char *name, HDoff_t offset, hsize_t size);
+H5_DLL herr_t H5Pset_external(hid_t plist_id, const char *name, haddr_t offset, hsize_t size);
 /**
  * \ingroup DCPL
  *
diff --git a/src/H5private.h b/src/H5private.h
index cff6b37390c..43ea4f6b696 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -591,9 +591,19 @@ typedef double _Complex H5_double_complex;
 typedef long double _Complex H5_ldouble_complex;
 #endif
 
+/* off_t exists on Windows, but is always a 32-bit long, even on 64-bit Windows,
+ * so on Windows we define HDoff_t to be int64_t, which is equivalent to __int64,
+ * the type of the st_size field of the _stati64 struct.
+ */
+#ifdef H5_HAVE_WIN32_API
+typedef int64_t HDoff_t;
+#else
+typedef off_t HDoff_t;
+#endif
+
 /* __int64 is the correct type for the st_size field of the _stati64
  * struct on Windows (MSDN isn't very clear about this). POSIX systems use
- * off_t. Both of these are typedef'd to HDoff_t in H5public.h.
+ * off_t. Both of these are typedef'd to HDoff_t (above).
  */
 typedef HDoff_t h5_stat_size_t;
 
diff --git a/src/H5public.h b/src/H5public.h
index 62e0db9764b..8e5d946fec3 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -300,22 +300,6 @@ typedef long long ssize_t;
  */
 typedef uint64_t hsize_t;
 
-/* off_t exists on Windows, but is always a 32-bit long, even on 64-bit Windows,
- * so on Windows we define HDoff_t to be int64_t, which is equivalent to __int64,
- * the type of the st_size field of the _stati64 struct.
- */
-#ifdef H5_HAVE_WIN32_API
-/**
- * Platform-independent offset
- */
-typedef int64_t HDoff_t;
-#else
-/**
- * Platform-independent offset
- */
-typedef off_t HDoff_t;
-#endif
-
 #ifdef H5_HAVE_PARALLEL
 #define HSIZE_AS_MPI_TYPE MPI_UINT64_T
 #endif
diff --git a/test/external.c b/test/external.c
index c7354f9afa4..58953b8d84d 100644
--- a/test/external.c
+++ b/test/external.c
@@ -97,7 +97,7 @@ test_non_extendible(hid_t file)
     hsize_t cur_size[1] = {100};           /* data space current size              */
     hsize_t max_size[1] = {100};           /* data space maximum size              */
     int     n           = 0;               /* number of external files             */
-    HDoff_t file_offset = 0;               /* external file offset                 */
+    haddr_t file_offset = 0;               /* external file offset                 */
     hsize_t file_size   = 0;               /* sizeof external file segment         */
     haddr_t dset_addr   = HADDR_UNDEF;     /* address of dataset                   */
 
@@ -363,7 +363,7 @@ test_unlimited(hid_t file)
     hsize_t cur_size[1] = {100};           /* data space current size       */
     hsize_t max_size[1] = {H5S_UNLIMITED}; /* data space maximum size       */
     int     n;                             /* number of external files      */
-    HDoff_t file_offset;                   /* external file offset          */
+    haddr_t file_offset;                   /* external file offset          */
     hsize_t file_size;                     /* sizeof external file segment  */
 
     TESTING("unlimited dataspace, unlimited external storage");
@@ -446,7 +446,7 @@ test_unlimited(hid_t file)
  *-------------------------------------------------------------------------
  */
 static int
-add_external_files(hid_t dcpl_id, unsigned int n_external_files, HDoff_t offset, hsize_t max_ext_size)
+add_external_files(hid_t dcpl_id, unsigned int n_external_files, haddr_t offset, hsize_t max_ext_size)
 {
     char         exname[AEF_EXNAME_MAX_LEN + 1];
     unsigned int i = 0;
@@ -704,7 +704,7 @@ test_read_file_set(hid_t fapl)
         FAIL_STACK_ERROR;
     for (i = 0; i < N_EXT_FILES; i++) {
         snprintf(filename, sizeof(filename), "extern_%dr.raw", (int)i + 1);
-        if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
+        if (H5Pset_external(dcpl, filename, (haddr_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
             FAIL_STACK_ERROR;
     }
 
@@ -823,7 +823,7 @@ test_write_file_set(hid_t fapl)
         else
             size = H5F_UNLIMITED;
 
-        if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), size) < 0)
+        if (H5Pset_external(dcpl, filename, (haddr_t)(i * GARBAGE_PER_FILE), size) < 0)
             FAIL_STACK_ERROR;
     } /* end for */
 
@@ -946,7 +946,7 @@ test_path_absolute(hid_t fapl)
         if (i == 1)
             snprintf(filename, sizeof(filename), "%s%sextern_%zur.raw", cwdpath + 2, H5_DIR_SEPS, i + 1);
 #endif
-        if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
+        if (H5Pset_external(dcpl, filename, (haddr_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
             FAIL_STACK_ERROR;
     }
 
@@ -1036,7 +1036,7 @@ test_path_relative(hid_t fapl)
         FAIL_STACK_ERROR;
     for (i = 0; i < N_EXT_FILES; i++) {
         snprintf(filename, sizeof(filename), "extern_%dr.raw", (int)i + 1);
-        if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
+        if (H5Pset_external(dcpl, filename, (haddr_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
             FAIL_STACK_ERROR;
     }
 
@@ -1130,7 +1130,7 @@ test_path_relative_cwd(hid_t fapl)
         FAIL_STACK_ERROR;
     for (i = 0; i < N_EXT_FILES; i++) {
         snprintf(filename, sizeof(filename), "..%sextern_%dr.raw", H5_DIR_SEPS, (int)i + 1);
-        if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
+        if (H5Pset_external(dcpl, filename, (haddr_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
             FAIL_STACK_ERROR;
     }
 
diff --git a/test/external_env.c b/test/external_env.c
index 9e0305394e3..f6956bd5264 100644
--- a/test/external_env.c
+++ b/test/external_env.c
@@ -68,7 +68,7 @@ test_path_env(hid_t fapl)
         FAIL_STACK_ERROR;
     for (i = 0; i < N_EXT_FILES; i++) {
         snprintf(filename, sizeof(filename), "..%sextern_env_%dr.raw", H5_DIR_SEPS, (int)i + 1);
-        if (H5Pset_external(dcpl, filename, (HDoff_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
+        if (H5Pset_external(dcpl, filename, (haddr_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
             FAIL_STACK_ERROR;
     } /* end for */
 
diff --git a/test/set_extent.c b/test/set_extent.c
index 0127e870174..a4e7e275b07 100644
--- a/test/set_extent.c
+++ b/test/set_extent.c
@@ -1839,7 +1839,7 @@ test_external(hid_t fapl, bool use_select_io)
     {
 
         char    name[256];   /*external file name        */
-        HDoff_t file_offset; /*external file offset        */
+        haddr_t file_offset; /*external file offset        */
         hsize_t file_size;   /*sizeof external file segment    */
 
         if (H5Pget_external(dcpl, 0, sizeof(name), name, &file_offset, &file_size) < 0)
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 6c9a1cfd0ef..114ab43c7b6 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -3190,7 +3190,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
     H5D_layout_t     stl      = H5D_LAYOUT_ERROR;
     size_t           ncols    = 80; /* available output width        */
     size_t           cd_nelmts;     /* filter client number of values */
-    HDoff_t          offset;        /* offset of external file     */
+    haddr_t          offset;        /* offset of external file     */
     char             f_name[256];   /* filter name */
     char             name[256];     /* external or virtual file name       */
     hsize_t          chsize[64];    /* chunk size in elements */
@@ -3342,11 +3342,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
 
                     h5tools_str_reset(&buffer);
                     h5tools_str_append(&buffer, "FILENAME %s SIZE %" PRIuHSIZE, name, size);
-                    /* Using %lld with a cast to (long long) is probably the only portable
-                     * way to print off_t values. There's no real standard for off_t other
-                     * than it must be signed, according to POSIX.
-                     */
-                    h5tools_str_append(&buffer, " OFFSET %lld", (long long)offset);
+                    h5tools_str_append(&buffer, " OFFSET %" PRIuHADDR "", offset);
                     h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0,
                                            (hsize_t)0);
                 }
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index 992d412f368..0402c0117d6 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -1911,7 +1911,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
     size_t            cd_num;        /* filter client data counter */
     char              f_name[256];   /* filter/file name */
     char              s[64];         /* temporary string buffer */
-    HDoff_t           f_offset;      /* offset in external file */
+    haddr_t           f_offset;      /* offset in external file */
     hsize_t           f_size;        /* bytes used in external file */
     hsize_t           total, used;   /* total size or offset */
     int               ndims;         /* dimensionality */
diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c
index 4f1aa20fbf9..2766e8e8a30 100644
--- a/tools/src/misc/h5repart.c
+++ b/tools/src/misc/h5repart.c
@@ -371,7 +371,7 @@ main(int argc, char *argv[])
          * needed. The first member is extended to the logical member size
          * but other members might be smaller if they end with a hole.
          */
-        dst_offset = dst_offset + (off_t)n;
+        dst_offset = dst_offset + (HDoff_t)n;
         if (dst_is_family && dst_offset == dst_size) {
             if (0 == dst_membno) {
                 if (HDlseek(dst, dst_size - 1, SEEK_SET) < 0) { |