Skip to content

Adapt to HDF4 4.4.0 API changes - #482

Open
llimeht wants to merge 2 commits into
nexusformat:masterfrom
llimeht:tmp/hdf44
Open

llimeht wants to merge 2 commits into
nexusformat:masterfrom
llimeht:tmp/hdf44

Conversation

@llimeht

@llimeht llimeht commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

HDF4.4 changes the function signature of the Vgetname and Vgetclass functions to include a buffer length in/out parameter.

This PR updates all usage of Vgetname and Vgetclass to include the new size_t* buffer size argument, using the size of the buffer that has been allocated as part of the typedef.

Closes: #481

Update all usage of Vgetname and Vgetclass to include the new size_t*
buffer size argument, using the size of the buffer that has been allocated
as part of the typedef.
The NeXus API takes NXname (char[128]) buffers for names and classes.
test/napi_test.c declared these name buffers as char[64] and got away
with this mismatch because previous versions of HDF4 only wrote the
actual (shorter) names; HDF4 4.4.0 NUL-pads the entire buffer, meaning
that the write spills over. Depending on compiler options and
architecture details, this can cause the test to segfault.
@rayosborn

Copy link
Copy Markdown
Contributor

In case you are not aware, the NeXus C-API is no longer supported by the NeXus International Advisory Committee, and the original author has now retired. I believe that it is even under discussion whether this repository should be removed from this organization's Github pages. If you are interested in maintaining this code, it may be sensible to fork the repository to keep it active. I can raise the issue at the next NIAC teleconference.

@llimeht

llimeht commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Hi @rayosborn, I'm not looking to be the long term maintainer of the library; I'm just keeping it alive in Debian (and derivatives) as it appears to be used by a couple of other packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fails to build with HDF 4.4.0

2 participants