Skip to content

Byte order test is incorrect #57

@davidchisnall

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

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