diff options
author | David Young <dyoung@hdfgroup.org> | 2020-09-28 19:42:18 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-09-28 19:42:18 (GMT) |
commit | 14851e3b82a9b116153f9505654faf2f60e1abe2 (patch) | |
tree | 4ab01f77f124bad03f76338e70b6e2b3f0fb01e5 /src/H5Smpio.c | |
parent | 8ee8b7abb55bc8d901e31b3eef9ba35abb352814 (diff) | |
parent | c0fbc5c086566d5d3c1d1ef26baa81a53d59fc08 (diff) | |
download | hdf5-14851e3b82a9b116153f9505654faf2f60e1abe2.zip hdf5-14851e3b82a9b116153f9505654faf2f60e1abe2.tar.gz hdf5-14851e3b82a9b116153f9505654faf2f60e1abe2.tar.bz2 |
Merge pull request #2650 in HDFFV/hdf5 from ~DYOUNG/werror:rebased-fprintf-experiment to develop
* commit 'c0fbc5c086566d5d3c1d1ef26baa81a53d59fc08': (24 commits)
Use the right format string, "%zu", for size_t.
Repair more format strings.
Fix a bunch of format string errors reported by Larry.
Fix some HDfprintf compilation errors: use the right format strings ("zu", PRIuHSIZE), avoid casting some printf arguments, pass the right number of arguments.
Test the format string "ll" before "l", "L", and "q", like the ./configure script does. This ought to fix the compilation failure in test/dt_arith.c that Allen told me about:
Cast a non-void pointer to void pointer for "%p".
Use PRIu32 and "zu" formats. Delete some casts from `size_t`.
I'm taking a guess that this code intended to point the 2-digit wide hexadecimal octet values, not 2 character-wide pointers to the bytes. The %02p format, which is a GNU-ism, disagreed with GCC 8.3.0 and the option flags we use.
%08p is not portable, it's a GNU-ism. Use %8p, instead. Squashes a GCC error.
Add format string macros PRI[doxX]HID for hid_t and use PRIdHID.
Use HDva_copy() and introduce a bunch of compatbility format-string constants for uppercase hexadecimal strings, `PRIX...`. Should fix the VS2010 errors that Allen mentioned:
Always #define HDfprintf as fprintf in this header. I believe this will fix the Windows build error that Allen reported.
Provide an HDvasprintf implementation only if it isn't #defined. This should fix the mingw compilation issue that Allen reported.
Fix va_list usage in the vasprintf(3) implementation.
Promote format-string warnings to errors.
Use the portable `-eq` operator instead of the bash-ism `==`. Fixes the tests on NetBSD, where /bin/sh != bash.
Restore a literal percent sign ("%%") that I accidentally deleted.
Fix code that made GCC complain about a NULL or `unsigned char *` arguments for "%s".
Take pains to provide UINT64_MAX in all conditions.
Correct a couple of format strings.
...
Diffstat (limited to 'src/H5Smpio.c')
-rw-r--r-- | src/H5Smpio.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 147fd25..2f8c43a 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -704,7 +704,7 @@ if(H5DEBUG(S)) #ifdef H5S_DEBUG if(H5DEBUG(S)) { - HDfprintf(H5DEBUG(S), "%s: start=%Hd stride=%Hu count=%Hu block=%Hu xtent=%Hu", + HDfprintf(H5DEBUG(S), "%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE " block=%" PRIuHSIZE " xtent=%" PRIuHSIZE, FUNC, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent); if(u == 0) HDfprintf(H5DEBUG(S), " rank=%u\n", rank); @@ -736,7 +736,7 @@ if(H5DEBUG(S)) #ifdef H5S_DEBUG if(H5DEBUG(S)) { - HDfprintf(H5DEBUG(S), "%s: start=%Hd stride=%Hu count=%Hu block=%Hu xtent=%Hu", + HDfprintf(H5DEBUG(S), "%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE " block=%" PRIuHSIZE " xtent=%" PRIuHSIZE, FUNC, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent); if(u == 0) HDfprintf(H5DEBUG(S), " rank=%u\n", rank); @@ -761,7 +761,7 @@ if(H5DEBUG(S)) { #ifdef H5S_DEBUG if(H5DEBUG(S)) { i = ((int)rank) - 1; - HDfprintf(H5DEBUG(S), " offset[%2d]=%Hu; max_xtent[%2d]=%Hu\n", i, offset[i], i, max_xtent[i]); + HDfprintf(H5DEBUG(S), " offset[%2d]=%" PRIuHSIZE "; max_xtent[%2d]=%" PRIuHSIZE "\n", i, offset[i], i, max_xtent[i]); } #endif for(i = ((int)rank) - 2; i >= 0; --i) { @@ -769,7 +769,7 @@ if(H5DEBUG(S)) { max_xtent[i] = max_xtent[i + 1] * d[i].xtent; #ifdef H5S_DEBUG if(H5DEBUG(S)) - HDfprintf(H5DEBUG(S), " offset[%2d]=%Hu; max_xtent[%2d]=%Hu\n", i, offset[i], i, max_xtent[i]); + HDfprintf(H5DEBUG(S), " offset[%2d]=%" PRIuHSIZE "; max_xtent[%2d]=%" PRIuHSIZE "\n", i, offset[i], i, max_xtent[i]); #endif } /* end for */ @@ -784,9 +784,9 @@ if(H5DEBUG(S)) *******************************************************/ #ifdef H5S_DEBUG if(H5DEBUG(S)) { - HDfprintf(H5DEBUG(S), "%s: Making contig type %Zu MPI_BYTEs\n", FUNC, elmt_size); + HDfprintf(H5DEBUG(S), "%s: Making contig type %zu MPI_BYTEs\n", FUNC, elmt_size); for(i = ((int)rank) - 1; i >= 0; --i) - HDfprintf(H5DEBUG(S), "d[%d].xtent=%Hu \n", i, d[i].xtent); + HDfprintf(H5DEBUG(S), "d[%d].xtent=%" PRIuHSIZE "\n", i, d[i].xtent); } #endif @@ -814,7 +814,9 @@ if(H5DEBUG(S)) { #ifdef H5S_DEBUG if(H5DEBUG(S)) HDfprintf(H5DEBUG(S), "%s: Dimension i=%d \n" - "start=%Hd count=%Hu block=%Hu stride=%Hu, xtent=%Hu max_xtent=%d\n", + "start=%" PRIdHSIZE " count=%" PRIuHSIZE " block=%" PRIuHSIZE + " stride=%" PRIuHSIZE ", xtent=%" PRIuHSIZE + " max_xtent=%" PRIuHSIZE "\n", FUNC, i, d[i].start, d[i].count, d[i].block, d[i].strid, d[i].xtent, max_xtent[i]); #endif @@ -955,7 +957,7 @@ done: #ifdef H5S_DEBUG if(H5DEBUG(S)) - HDfprintf(H5DEBUG(S), "Leave %s, count=%ld is_derived_type=%t\n", FUNC, *count, *is_derived_type); + HDfprintf(H5DEBUG(S), "Leave %s, count=%d is_derived_type=%s\n", FUNC, *count, (*is_derived_type) ? "TRUE" : "FALSE"); #endif FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__mpio_reg_hyper_type() */ |