I try to write a fill value message version 3 where the fill value is undefined. This works fine for h5dump 1.12 and lower (it can dump the file) but fails for version 1.14 with the error have value and undefined value flags both set
.
The block of code where this error occurs has actually changed between both versions:
1.12:
1.14:
The 1.12 condition !(flags & H5O_FILL_FLAG_HAVE_VALUE)
(which makes sense) has changed in 1.14 to flags & (unsigned)~H5O_FILL_FLAG_HAVE_VALUE
which I do not understand.
More specifically, I do not understand why the constant H5O_FILL_FLAG_HAVE_VALUE
is being inverted using the tilde operator (~
). Without that operator, this line of code would simply check if bit 5 is set but with the inverting operation it checks if any bit is set and bit 5 is being ignored. This must always fail (i.e. H5GOTO_ERROR is invoked) because bit 4 (H5O_FILL_FLAG_UNDEFINED_VALUE
) is set and so the if condition is fulfilled.
I think the new code will always fail if the fill value is undefined. Or maybe I have some misunderstanding of the code, but my tests show that everything is fine with the 1.12 branch and it starts to fail with the 1.14 branch.
Thanks again!