Re: pgsql: Test pg_atomic_fetch_add_ with variable addend and 16-bit edge c

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Test pg_atomic_fetch_add_ with variable addend and 16-bit edge c
Date: 2019-09-15 16:00:21
Message-ID: 20190915160021.GA24376@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On 2019-Sep-14, Noah Misch wrote:

> Test pg_atomic_fetch_add_ with variable addend and 16-bit edge cases.

I don't understand this.

if (pg_atomic_fetch_add_u32(&var, INT_MAX) != INT_MAX)
elog(ERROR, "pg_atomic_add_fetch_u32() #3 wrong");

pg_atomic_fetch_add_u32(&var, 2); /* wrap to 0 */

if (pg_atomic_fetch_add_u32(&var, PG_INT16_MAX) != 0)
elog(ERROR, "pg_atomic_fetch_add_u32() #3 wrong");

The existing one seems to be naming the wrong function in the error
message, and if you fix that then you have two "#3 wrong" cases.
Isn't this confusing? Am I just too sensitive? Is this pointless to
fix?

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2019-09-15 22:14:50 Re: pgsql: Test pg_atomic_fetch_add_ with variable addend and 16-bit edge c
Previous Message Tom Lane 2019-09-15 15:52:06 pgsql: Fix bogus sizeof calculations.