Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

now testing that endianness can only be set on atomic ints and floats #1530

Merged

Conversation

edhartnett
Copy link
Contributor

@edhartnett edhartnett commented Nov 15, 2019

Fixes #1479

As is clearly stated in the documentation for nc_def_var_endian():

Warning: this function is only defined if the type of the variable is an atomic integer or float type.

But this was not actually being checked in the code. Setting the endianness for other types is not safe. If there is an interest in controlling endianess for user-defined types, we can pursue that as a separate and new feature. (But no one wants it anyway.)

In this PR I add checking to ensure that endianness is only set on atomic integer or float types. Tests are added to confirm.

@WardF WardF merged commit 923d4cc into Unidata:master Nov 15, 2019
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.

Error in netcdf-4 endianness handling?
2 participants