[MacPorts] #62341: macOS arm64 version of hdf4 produces wrong results
MacPorts
noreply at macports.org
Sun Feb 21 14:41:39 UTC 2021
#62341: macOS arm64 version of hdf4 produces wrong results
-------------------------+--------------------
Reporter: svniemeijer | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: | Port:
-------------------------+--------------------
When running the following program against any of the files from
https://nsidc.org/data/NISE
{{{
#include <assert.h>
#include <stdio.h>
#include "hdf.h"
#include "mfhdf.h"
int main(int argc, char *argv[])
{
int32 sd_id, sds_id, rank, dimsizes[H4_MAX_VAR_DIMS], data_type,
num_attributes, i;
char sds_name[H4_MAX_NC_NAME + 1];
int result;
sd_id = SDstart("NISE_SSMISF18_20210111.HDFEOS", DFACC_READ);
sds_id = SDselect(sd_id, 0);
result = SDgetinfo(sds_id, sds_name, &rank, dimsizes, &data_type,
&num_attributes);
assert(result == 0);
for (i = 0; i < rank; i++)
{
printf("%d\n", dimsizes[i]);
}
return 0;
}
}}}
On x86_64 this gives 721 (twice). But on arm64 it gives -788398080
(twice).
The data is rank 2, 721 x 721. So the x86_64 output is correct.
It looks like the arm64 build of HDF4 is incorrectly treating the platform
as big endian.
--
Ticket URL: <https://trac.macports.org/ticket/62341>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list