Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Provide overflow safe integer math inline functions.

From: Christoph Berg <myon(at)debian(dot)org>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-committers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Provide overflow safe integer math inline functions.
Date: 2017-12-14 08:28:08
Message-ID: 20171214082808.GA5775@msg.df7cb.de (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-committerspgsql-hackers
Re: Andres Freund 2017-12-13 <20171213173524(dot)rjs7b3ahsong5zko(at)alap3(dot)anarazel(dot)de>
> On 2017-12-13 09:37:25 -0500, Robert Haas wrote:
> > On Wed, Dec 13, 2017 at 5:10 AM, Christoph Berg <myon(at)debian(dot)org> wrote:
> > > Re: Andres Freund 2017-12-13 <E1eOvQF-00075r-Cy(at)gemulon(dot)postgresql(dot)org>
> > >> Provide overflow safe integer math inline functions.
> > >
> > > The new _overflow functions have buggy comments:
> > >
> > > /*
> > >  * If a - b overflows, return true, otherwise store the result of a + b into
> > >  * *result.                                                         ^ there
> > 
> > What's wrong with that?
> 
> After staring at it for a while, I seem to have partially mis-copied the
> note for addition to the subtraction operation...

I believe the attached is the correct version.

Christoph

Attachment: int.h-comments
Description: text/plain (2.9 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Andres FreundDate: 2017-12-14 09:12:38
Subject: Re: [HACKERS] Parallel Hash take II
Previous:From: Michael PaquierDate: 2017-12-14 08:08:44
Subject: Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL

pgsql-committers by date

Next:From: Teodor SigaevDate: 2017-12-14 11:30:42
Subject: pgsql: Add approximated Zipfian-distributed random generator to pgbench
Previous:From: Michael PaquierDate: 2017-12-14 04:05:32
Subject: Re: pgsql: Provide overflow safe integer math inline functions.

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group