diff options
author | Mark Leyva <maleyva1@users.noreply.github.com> | 2024-08-12 09:10:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-12 18:10:33 +0200 |
commit | c5b206d4ac6704147d9ec27506b9d0171f3a9501 (patch) | |
tree | b2ab541a048a7fd169d7eeff78530b9637de8c01 /tests/int/t1.nim | |
parent | 630c304a2dff6be70717224e533c1ad6f01875e3 (diff) | |
download | Nim-c5b206d4ac6704147d9ec27506b9d0171f3a9501.tar.gz |
fix #23817; Use __builtin_saddl_overflow variants for arm-none-eabi-gcc. (#23835)
Provides a fix for #23817. With target `arm-none-eabi`, GCC defines `int32_t` to `long 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](https://gcc.gnu.org/gcc-14/porting_to.html#c) and [here](https://gcc.gnu.org/pipermail/gcc-cvs/2023-December/394351.html). The proposed PR attempts to address this issue for these targets by defining the `nimAddInt`, `nimSubInt`, and `nimMulInt` 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` as `long int` and has no need for this patch. Thus, we only define the above macros for GCC targeting `arm-non-eabi`.
Diffstat (limited to 'tests/int/t1.nim')
0 files changed, 0 insertions, 0 deletions