Skip to content

fix: extend BP_BIG_ENDIAN auto-detection to cover TI ARM CGT - #84

Merged
hit9 merged 2 commits into
hit9:masterfrom
mpspace-io:fix/bp-big-endian-ti-cgt-detection
Jun 19, 2026
Merged

hit9 merged 2 commits into
hit9:masterfrom
mpspace-io:fix/bp-big-endian-ti-cgt-detection

Conversation

@dcasnowdon

Copy link
Copy Markdown
Contributor

The existing check only recognised GCC/Clang's BYTE_ORDER / ORDER_BIG_ENDIAN pair. TI's ARM CGT compiler (used with --be32 for big-endian Cortex-R targets such as the TMS570) does not define those macros; it defines BIG_ENDIAN instead.

Without this fix the dual-path codegen (endian="both") falls through to the #ifndef BP_BIG_ENDIAN (little-endian byte-pointer) branch on TI big-endian targets, producing incorrect encode/decode results for multi-byte fields.

Add BIG_ENDIAN as a second detection arm so BP_BIG_ENDIAN is set correctly on TI CGT and other toolchains that follow the same convention.

The existing check only recognised GCC/Clang's __BYTE_ORDER__ /
__ORDER_BIG_ENDIAN__ pair.  TI's ARM CGT compiler (used with --be32
for big-endian Cortex-R targets such as the TMS570) does not define
those macros; it defines __BIG_ENDIAN__ instead.

Without this fix the dual-path codegen (endian="both") falls through
to the #ifndef BP_BIG_ENDIAN (little-endian byte-pointer) branch on
TI big-endian targets, producing incorrect encode/decode results for
multi-byte fields.

Add __BIG_ENDIAN__ as a second detection arm so BP_BIG_ENDIAN is set
correctly on TI CGT and other toolchains that follow the same
convention.
@hit9
hit9 merged commit e75b0ee into hit9:master Jun 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants