HDFGroup / HDFGroup/hdf5

H5Aget_storage_size, H5Dget_storage_size: Fix error return

Open
#5,948 0 comments 0 reactions 1 assignee Claimed by @brtnfld View on GitHub
Dominant language
C
Stars
988
Forks
355
Avg merge
4d 2h
Merged PRs (30d)
12

Description

Fix this:
> Warning: **H5Dget_storage_size()** does not differentiate between 0 (zero), the value returned for the storage size of a dataset with no stored values, and 0 (zero), the value returned to indicate an error.

**H5Aget_storage_size()** has the same problem, except it is undocumented in the current reference manual.

Please add error returns for these functions. Some applications need to know the error status. This will be tricky because the current return type is an unsigned integer, and nothing else. Therefore an error sentinel such as -1 is not possible, and any positive sentinel would be misleading.

It seems to me that the most cautious strategy will be to introduce a second return item for a function status code. Yes this means a second argument, and versioned functions.

Changing the primary return type from unsigned to signed, and using a negative sentinel, might also be okay. This would also need versioned functions to do it properly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.