Re: [Mingw-w64-public] [PATCH] headers: Implement the _bittest* intrinsics for arm and aarch64

2021-07-14 Thread Martin Storsjö
On Wed, 14 Jul 2021, LIU Hao wrote: 在 7/14/21 9:02 PM, Martin Storsjö 写道: +unsigned char _bittestandset(__LONG32 *__a, __LONG32 __b) +{ +unsigned char __v = (*__a >> __b) & 1; +*__a |= (1 << __b); I suggest `1UL` here, as shifting 1 to the left by 31 is undefined behavior. Thanks,

Re: [Mingw-w64-public] [PATCH] headers: Implement the _bittest* intrinsics for arm and aarch64

2021-07-14 Thread LIU Hao
在 7/14/21 9:02 PM, Martin Storsjö 写道: +unsigned char _bittestandset(__LONG32 *__a, __LONG32 __b) +{ +unsigned char __v = (*__a >> __b) & 1; +*__a |= (1 << __b); I suggest `1UL` here, as shifting 1 to the left by 31 is undefined behavior. +unsigned char _bittestandreset(__LONG32