pgsql: Bring some MSVC asserts in line with other platforms - Mailing list pgsql-committers

From John Naylor
Subject pgsql: Bring some MSVC asserts in line with other platforms
Date
Msg-id E1qQNka-0027Pv-2Y@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.gmail.com

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(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Add WAIT_EVENT_{CLASS,ID}_MASK in wait_event.c
Next
From: Michael Paquier
Date:
Subject: pgsql: Support custom wait events for wait event type "Extension"