-
- Downloads
Detect the endianness with CMake (!111)
## What is the bug The endianness detection in `src/util_hash.c` produces a false result on macOS with GCC 13 or later. For whatever reason, [`#include <sys/param.h>`](https://gitlab.dkrz.de/icon-libraries/libfortran-support/-/blob/316d3dc6edb6ef0f4f1b9adaf9f3cb27a7bb831a/src/util_hash.c#L49) does not define the `__DARWIN_BYTE_ORDER` and `__DARWIN_LITTLE_ENDIAN` macros when [`#define _POSIX_C_SOURCE 200112L`](https://gitlab.dkrz.de/icon-libraries/libfortran-support/-/blob/316d3dc6edb6ef0f4f1b9adaf9f3cb27a7bb831a/src/util_hash.c#L45). And that leads to the wrong values of the `HASH_LITTLE_ENDIAN` and `HASH_BIG_ENDIAN` macros. See also https://gitlab.dkrz.de/icon/icon-mpim/-/merge_requests/684#note_300951 . ## How do you fix it The endianness detection is delegated to CMake. Approved-by:Yen-Chen Chen <yen-chen.chen@tum.de> Merged-by:
Yen-Chen Chen <yen-chen.chen@tum.de> Changelog: bugfix
parent
316d3dc6
No related branches found
No related tags found
Please register or sign in to comment