H5Iis_valid( H5P_DEFAULT ) returns 0


while adding comprehensive error handling to H5CPP I came to notice that H5Iis_valid( H5P_DEFAULT ) returns 0 instead the expected 1.

According to the documentation found here:https://support.hdfgroup.org/HDF5/doc/RM/RM_H5I.html#Identify-IsValid
I am expecting 1 or TRUE.

I am linking against hdf5-1.10.2 and wondering if this is the expected behaviour and I am misinterpreting something?


Hi Steven,

H5P_DEFAULT looks like just a default value. It is defined in H5Ppublic.h:

/* Default value for all property list classes */
#define H5P_DEFAULT (hid_t)0

An HDF5 API with a parameter that is a property list identifier will check for H5P_DEFAULT and set the appropriate property list identifier if found. For example, this is from the H5Dcreate2 code:

H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id)

if(H5P_DEFAULT == lcpl_id)

If you pass in H5P_LINK_CREATE_DEFAULT to H5Iis_valid it will return a value of 1, as that is a valid property list identifier.


That did it, thank you very much!