pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Naylor <john.naylor@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Bring some MSVC asserts in line with other platforms
Date: Mon, 31 Jul 2023 07:55:33 +0000
Message-ID: <E1qQNka-0027Pv-2Y@gemulon.postgresql.org> (raw)

Bring some MSVC asserts in line with other platforms

MSVC's _BitScan* functions return a boolean indicating whether any
bits were set in the input, and we were previously asserting that
they returned true, per our API. This is correct. However, other
platforms simply assert that the input is non-zero, so do that to be
more consistent.

Noted while investigating a hypothesis from Ranier Vilela about
undefined behavior, but this is not his proposed patch.

Discussion: https://www.postgresql.org/message-id/CAEudQAoDhUZyKGJ1vbMGcgVUOcsixe-%3DjcVaDWarqkUg163D2w%40mail.g...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/39055cb4ccd5b521ceb802b6a8194de912a422cc

Modified Files
--------------
src/include/port/pg_bitutils.h | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)



Message-ID: <E1qQNka-0027Pv-2Y@gemulon.postgresql.org>
Permalink:  ../E1qQNka-0027Pv-2Y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qQNka-0027Pv-2Y@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: john.naylor@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Bring some MSVC asserts in line with other platforms
  In-Reply-To: <E1qQNka-0027Pv-2Y@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