You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This design decision was probably motivated by the guessing mechanism for integer type sizes in hdf5 versions < 1.13.0, where hsize_t was defined as:
typedefunsigned long longhsize_t;
(sources: v1.10.0 and v1.12.0). In function overload resolution, this type is considered different from std::size_t (typically defined as unsigned long on 64-bit architectures), although they have the same size.
Starting with hdf5 1.13.0 (HDFGroup/hdf5#709), it is now defined as:
typedefuint64_thsize_t;
(sources: v1.13.0 and v1.14.1), which can be identical to std::size_t on 64-bit implementations, in which case overload resolution would fail.
One could solve this compatibility issue by wrapping all std::size_t overloads inside adequate ifdef guards, for example:
The correct solution will likely look a bit more complicated than that, once portability concerns are factored in. For example, on 32-bit architectures std::size_t can be 4 bytes wide, in which case it is not equivalent to uint64_t and the std::size_t overloads are still needed.
Many thanks to William Brown for initially reporting the issue on the ESPResSo mailing list (thread from Fri, 4 Aug 2023, link).
The text was updated successfully, but these errors were encountered:
The source code currently contains function overloads that match against two size types,
std::size_t
andhsize_t
, e.g.:h5xx/h5xx/dataspace/dataspace.hpp
Lines 49 to 53 in 459f07a
This design decision was probably motivated by the guessing mechanism for integer type sizes in hdf5 versions < 1.13.0, where
hsize_t
was defined as:(sources: v1.10.0 and v1.12.0). In function overload resolution, this type is considered different from
std::size_t
(typically defined asunsigned long
on 64-bit architectures), although they have the same size.Starting with hdf5 1.13.0 (HDFGroup/hdf5#709), it is now defined as:
(sources: v1.13.0 and v1.14.1), which can be identical to
std::size_t
on 64-bit implementations, in which case overload resolution would fail.One could solve this compatibility issue by wrapping all
std::size_t
overloads inside adequate ifdef guards, for example:The correct solution will likely look a bit more complicated than that, once portability concerns are factored in. For example, on 32-bit architectures
std::size_t
can be 4 bytes wide, in which case it is not equivalent touint64_t
and thestd::size_t
overloads are still needed.Many thanks to William Brown for initially reporting the issue on the ESPResSo mailing list (thread from Fri, 4 Aug 2023, link).
The text was updated successfully, but these errors were encountered: