Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior
Date
Msg-id 20200831205018.qya6rkktlo6w5hal@alap3.anarazel.de
Whole thread Raw
In response to Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior  (Ranier Vilela <ranier.vf@gmail.com>)
List 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@anarazel.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.



pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior
Next
From: Peter Geoghegan
Date:
Subject: Re: Boundary value check in lazy_tid_reaped()