Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

Byte order test is incorrect #57

Description

@davidchisnall

This test checks whether __ORDER_BIG_ENDIAN__ is defined at all, but this predefined macro is not intended for that use case. It is identical to the custom IS_BIG_ENDIAN macro in the same file and is expected to be compared against __BYTE_ORDER__.

The current code unconditionally sets the byte order to big endian. The test probably should be:

# if defined(__BYTE_ORDER__)
#  define PLATFORM_BYTE_ORDER __BYTE_ORDER__
# elif defined(__BIG_ENDIAN)
#  define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
# else
#  define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
# endif

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions