From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix portability issues in pg_bitutils
Date: Wed, 13 Feb 2019 23:13:27 +0000
Message-ID: <E1gu3iZ-000223-K9@gemulon.postgresql.org> (raw)
Fix portability issues in pg_bitutils
We were using uint64 function arguments as "long int" arguments to
compiler builtins, which fails on machines where long ints are 32 bits:
the upper half of the uint64 was being ignored. Fix by using the "ll"
builtin variants instead, which on those machines take 64 bit arguments.
Also, remove configure tests for __builtin_popcountl() (as well as
"long" variants for ctz and clz): the theory here is that any compiler
version will provide all widths or none, so one test suffices. Were
this theory to be wrong, we'd have to add tests for
__builtin_popcountll() and friends, which would be tedious.
Per failures in buildfarm member lapwing and ensuing discussion.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/109de05cbb034b032cd60f50708716c8ff0afdf2
Modified Files
--------------
config/c-compiler.m4 | 58 ----------------
configure | 152 +++++++++++-------------------------------
configure.in | 7 +-
src/include/pg_config.h.in | 21 ++----
src/include/pg_config.h.win32 | 21 ++----
src/port/pg_bitutils.c | 73 ++++++++++----------
6 files changed, 87 insertions(+), 245 deletions(-)
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: alvherre@alvh.no-ip.org
Subject: Re: pgsql: Fix portability issues in pg_bitutils
In-Reply-To: <E1gu3iZ-000223-K9@gemulon.postgresql.org>
References: <E1gu3iZ-000223-K9@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