Re: pgsql: Fix integer-overflow problems in interval comparison.

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Fix integer-overflow problems in interval comparison.
Date: 2017-04-17 17:07:44
Message-ID: 20170417170744.74wmgapk3rdxdcbk@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On 2017-04-17 13:04:31 -0400, Tom Lane wrote:
> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> > On 4/5/17 23:51, Tom Lane wrote:
> >> Fix integer-overflow problems in interval comparison.
>
> > This is failing cpluspluscheck now because C++ does not have
> > _Static_assert, which is used in int128.h.
>
> Hmm. We could drop that assert, or move it to some .c file, or
> wrap it in "#ifndef __cplusplus" ... but really it seems like a
> more generic solution would be appropriate. This won't be the
> last time somebody tries to do that, what with our increasing
> use of inline functions.
>
> Maybe the definition of StaticAssertStmt should be tweaked based on
> __cplusplus?

That seems reasonable, possibly with a cplusplus version check and then
using static_assert()? Although I'd personally just mention that as a
todo for later.

> Or maybe the problem is cpluspluscheck's test methodology,
> ie you ought to run configure with CC=c++ before trying to compile the
> headers?

That seems unlikely to work well for the moment...

- Andres

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-04-17 17:49:51 pgsql: Fix perlcritic warnings
Previous Message Tom Lane 2017-04-17 17:04:31 Re: pgsql: Fix integer-overflow problems in interval comparison.