Re: BUG #18248: Expression is always zero

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: rekgrpth(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18248: Expression is always zero
Date: 2023-12-14 11:08:20
Message-ID: 58fa3c416a9dd4c98a2a541eb1afb67f586fbaaa.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 2023-12-14 at 05:32 +0000, PG Bug reporting form wrote:
> The value of expression 'thistimecnt >> 31 >> 31 >> 2' (in
> src/timezone/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.
>
> Maybe this was what was meant?
> thistimecnt >> 31 >> 2

This code is just taken from the GNU C library, and it's in our interest to
keep it as much aligned with upstram code as possible.

Yours,
Laurenz Albe

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Julien Rouhaud 2023-12-14 11:10:36 Re: BUG #18248: Expression is always zero
Previous Message Julien Rouhaud 2023-12-14 10:57:40 Re: BUG #18247: Integer overflow leads to negative width