summaryrefslogtreecommitdiffstats
path: root/test/fillval.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-09-28 19:42:18 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-09-28 19:42:18 (GMT)
commit14851e3b82a9b116153f9505654faf2f60e1abe2 (patch)
tree4ab01f77f124bad03f76338e70b6e2b3f0fb01e5 /test/fillval.c
parent8ee8b7abb55bc8d901e31b3eef9ba35abb352814 (diff)
parentc0fbc5c086566d5d3c1d1ef26baa81a53d59fc08 (diff)
downloadhdf5-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 'test/fillval.c')
-rw-r--r--test/fillval.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/fillval.c b/test/fillval.c
index 3fbbbbb..5ea296d 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -805,7 +805,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
if(fill_time!=H5D_FILL_TIME_NEVER && val_rd!=fillval) {
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
- HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, "
+ HDfprintf(stdout," Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE "}, read: %u, "
"Fill value: %u\n",
hs_offset[0], hs_offset[1],
hs_offset[2], hs_offset[3],
@@ -822,7 +822,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
rd_c.z != fill_c.z)) {
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
- HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %f, %d, %f, %c"
+ HDfprintf(stdout," Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE "}, read: %f, %d, %f, %c"
"Fill value: %f, %d, %f, %c\n",
hs_offset[0], hs_offset[1],
hs_offset[2], hs_offset[3],
@@ -862,7 +862,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
if(buf[u] != fillval) {
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
- HDfprintf(stdout," Elmt={%Hu, %Hu, %Hu, %Hu, %Hu}, read: %u, "
+ HDfprintf(stdout," Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE "}, read: %u, "
"Fill value: %u\n",
hs_offset[0], hs_offset[1],
hs_offset[2], hs_offset[3],
@@ -889,7 +889,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
!H5_DBL_ABS_EQUAL(buf_c[u].y, fill_c.y) || buf_c[u].z != fill_c.z) {
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
- HDfprintf(stdout," Elmt={%Hu, %Hu, %Hu, %Hu, %Hu}, read: %f, %d, %f, %c"
+ HDfprintf(stdout," Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE "}, read: %f, %d, %f, %c"
"Fill value: %f, %d, %f, %c\n",
hs_offset[0], hs_offset[1],
hs_offset[2], hs_offset[3],
@@ -1284,7 +1284,7 @@ test_extend_verify_integer(unsigned lineno, const hsize_t *offset,
/* Verify value */
if(*test_val != *compare_val) {
HDfprintf(stdout, "%u: Value read was not expected.\n", lineno);
- HDfprintf(stdout," Elmt = {%Hu, %Hu, %Hu, %Hu, %Hu}, read: %d, "
+ HDfprintf(stdout," Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE "}, read: %d, "
"expected: %d\n",
offset[0], offset[1],
offset[2], offset[3],
@@ -1380,7 +1380,7 @@ test_extend_verify_cmpd_vl(unsigned lineno, const hsize_t *offset,
HDstrcmp(test_val->b, compare_val->b) ||
(test_val->y != compare_val->y)) {
HDfprintf(stdout, "%u: Value read was not expected.\n", lineno);
- HDfprintf(stdout," Elmt = {%Hu, %Hu, %Hu, %Hu, %Hu}, read: {%d, '%s', '%s', %d} "
+ HDfprintf(stdout," Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE "}, read: {%d, '%s', '%s', %d} "
"expected: {%d, '%s', '%s', %d}\n",
offset[0], offset[1], offset[2], offset[3], offset[4],
test_val->x, test_val->a, test_val->b, test_val->y,