[tz] [BUG] Expression is always zero

Paul Eggert eggert at cs.ucla.edu
Thu Dec 14 18:48:59 UTC 2023


On 12/14/23 03:17, RekGRpth via tz wrote:
> The value of expression 'thistimecnt >> 31 >> 31 >> 2' (in
> zic.c) is zero regardless of the value of the left operand
> 'thistimecnt', because it is shifted by 64 (in total) bits, which is greater
> or equal to its size of 64 bits.

Its width is 64 bits on platforms where PTRDIFF_WIDTH == 64, but the C 
Standard allows PTRDIFF_WIDTH to be greater than 64. Admittedly few 
platforms do that today, but we might as well be portable to them.



More information about the tz mailing list