pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Return implementation defined value if pg_$op_s$bit_overflow ove
Date: Wed, 14 Feb 2018 22:30:24 +0000
Message-ID: <E1em5ZI-00036B-VZ@gemulon.postgresql.org> (raw)

Return implementation defined value if pg_$op_s$bit_overflow overflows.

Some older compilers otherwise sometimes complain about undefined
values, even though the return value should not be used in the
overflow case.  We assume that any decent compiler will optimize away
the unnecessary assignment in performance critical cases.

We do not want to restrain the returned value to a specific value,
e.g. 0 or the wrapped-around value, because some fast ways to
implement overflow detecting math do not easily allow for
that (e.g. msvc intrinsics).  As the function documentation already
documents the returned value in case of intrinsics to be
implementation defined, no documentation has to be updated.

Per complaint from Tom Lane and his buildfarm member prairiedog.

Author: Andres Freund
Discussion: https://postgr.es/m/18169.1513958454@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6d7dc5350042697bbb141a7362649db7fa67bd55

Modified Files
--------------
src/include/common/int.h | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)



Message-ID: <E1em5ZI-00036B-VZ@gemulon.postgresql.org>
Permalink:  ../E1em5ZI-00036B-VZ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1em5ZI-00036B-VZ@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Return implementation defined value if pg_$op_s$bit_overflow ove
  In-Reply-To: <E1em5ZI-00036B-VZ@gemulon.postgresql.org>
  References: <E1em5ZI-00036B-VZ@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox