64-bit Enums

Hi all,

I'm creating some Enum DataTypes in HDF5 and have successfully created several by calling enumCreate, enumInsert and then 'commit' to store them in the file. I'm running into a minor issue which I can't explain.

Some of the enums should be backed by 16 bit ints, some by 32 bit ints and some by 64 bit ints. I've had no trouble creating 16 or 32 bit int backed enums but encountered unexpected behaviour when creating 64 bit int backed enums.

The issue is this:

The library seems to accept each call I make, produces no errors on the console and no error statuses are returned. Yet despite this, the enums keep turning out as 32 bit int backed enums, and indeed the values for actual names seem to be capped to 32 bit numbers.

For example, the following would work fine:

enum LunchSelection
    CAKE = 5,
    DEATH = 7

The following would end up with the same output as above:

enum LunchSelection
    CAKE = 5,
    DEATH = 1125899906842631 // This ends up just being 7, despite the fact that it is actually (2^50) + 7

In the second example, the 32 most significant bits are removed and the 32 least significant bits remain to form a valid 32 bit number. I'd get output similar to the following from h5dump:

DATATYPE "LunchSelection" H5T_ENUM {
    "CAKE" 5;
    "DEATH" 7;

The only clue I've managed to find anywhere is that in standard C++, enums backed by a 64 bit int are not supported without certain compiler extensions that may be non-standard. My knowledge and experience of C++ is extremely limited so I do not know how reliable this information is. Any suggestions or ideas would be very much welcome.

I'm using HDF5 1.8.8 win 64 shared.

Kind regards,


This e-mail, including any attachments and response string, may contain proprietary information which is confidential and may be legally privileged. It is for the intended recipient only. If you are not the intended recipient or transmission error has misdirected this e-mail, please notify the author by return e-mail and delete this message and any attachment immediately. If you are not the intended recipient you must not use, disclose, distribute, forward, copy, print or rely on this e-mail in any way except as permitted by the author.