Skip to content

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

Merged
WardF merged 1 commit intoUnidata:masterfrom
NetCDF-World-Domination-Council:ejh_endianness
Nov 15, 2019
Merged

now testing that endianness can only be set on atomic ints and floats#1530
WardF merged 1 commit intoUnidata:masterfrom
NetCDF-World-Domination-Council:ejh_endianness

Conversation

@edhartnett
Copy link
Copy Markdown
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.

@edhartnett edhartnett requested a review from WardF as a code owner November 15, 2019 18:15
@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