Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

From: Andres Freund <andres(at)anarazel(dot)de>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior
Date: 2020-08-31 20:50:18
Message-ID: 20200831205018.qya6rkktlo6w5hal@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2020-08-31 17:35:14 -0300, Ranier Vilela wrote:
> Em seg., 31 de ago. de 2020 às 17:05, Andres Freund <andres(at)anarazel(dot)de>
> escreveu:
> > So it seems Rainier needs to turn this test off, because it actually is
> > intentional.
> >
> No problem.
> If intentional, the code at TransactionIdPrecedes, already knows that
> overflow can occur
> and trusts that the compiler will save it.

I don't know what you mean with "saving" it. Again, unsigned integer
overflow is well specified in C. All that's needed is for the compiler
to implement normal C.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2020-08-31 20:56:36 Re: Boundary value check in lazy_tid_reaped()
Previous Message Ranier Vilela 2020-08-31 20:35:14 Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior