fix #23817; Use __builtin_saddl_overflow variants for arm-none-eabi-gcc. #23835
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provides a fix for #23817.
With target
arm-none-eabi
, GCC definesint32_t
tolong int
. Nim uses__builtin_sadd_overflow
for 32-bit targets, but this emits warnings on GCC releases 13 and under, while generating an error on GCC 14. More info regarding this here and here.The proposed PR attempts to address this issue for these targets by defining the
nimAddInt
,nimSubInt
, andnimMulInt
macros to use the appropriate compiler intrinsics for this platform.As for as we know, the LLVM toolchain for bare metal Arm does not define
int32_t
aslong int
and has no need for this patch. Thus, we only define the above macros for GCC targetingarm-non-eabi
.