Hello Egor and Pavel,
30.09.2026 17:28, Pavel Borisov wrote:
Small fix for .out files to contain rightmost spaces.
Regards,
Egor Ivkov
Your patch looks good to me except the similar behavior of int2 and
int4 are never explained. In C11 and older int16 left arg bit shift
is not UB only if the result filts int32. There is no check for this
in the patch.
FWIW, this was already reported several times:
[1] https://www.postgresql.org/message-id/48099055.9040607%40dls.net
[2]
https://www.postgresql.org/message-id/16790-c2a81c92a8776c5b%40postgresql.org
[3]
https://www.postgresql.org/message-id/17167-028026e4ca333817%40postgresql.org
[4]
https://www.postgresql.org/message-id/19672-33e7d9d1be2229ea%40postgresql.org
By the way, having a RISC-V machine handy:
Linux orangepirv2 6.6.63-ky #1.0.0 SMP PREEMPT Wed Mar 12 09:04:00 CST 2025
riscv64 riscv64 riscv64 GNU/Linux
I've tried:
SELECT int4shl(1, 100);
int4shl
---------
16
(1 row)
Best regards,
Alexander