Skip to content
Snippets Groups Projects

Detect the endianness with CMake

Merged Sergey Kosukhin requested to merge fix-endianness into master
All threads resolved!

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> does not define the __DARWIN_BYTE_ORDER and __DARWIN_LITTLE_ENDIAN macros when #define _POSIX_C_SOURCE 200112L. 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.

How urgent is the bugfix

  • I need it as soon as possible
  • I can wait for a couple of days
  • None of my current codes is directly affected

Mandatory steps before review

  • Gitlab CI passes (Hint: use make format for linting)
  • Bugfix is covered by additional unit tests
  • Mark the merge request as ready by removing Draft:

Mandatory steps before merge

  • Test coverage does not decrease
  • Reviewed by a maintainer
  • Incorporate review suggestions
  • Prior to merging, please remove any boilerplate from the MR description, retaining only the What is the bug and How do you fix it section to maintain
  • Remember to edit the commit message and select the proper changelog category (feature/bugfix/other)

You are not supposed to merge this request by yourself, the maintainers of fortan-support take care of this action!

Edited by Yen-Chen Chen

Merge request reports

Merge request pipeline #96998 passed

Merge request pipeline passed for 621b5779

Test coverage 81.90% (0.00%) from 1 job

Merged by Yen-Chen ChenYen-Chen Chen 2 months ago (Feb 14, 2025 8:59am UTC)

Loading

Pipeline #97029 passed

Pipeline passed for 555fd59f on master

Test coverage 81.90% (0.00%) from 1 job

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading