Re: pgsql: Test pg_atomic_fetch_add_ with variable addend and 16-bitedge c - Mailing list pgsql-committers

From Alvaro Herrera
Subject Re: pgsql: Test pg_atomic_fetch_add_ with variable addend and 16-bitedge c
Date
Msg-id 20190915160021.GA24376@alvherre.pgsql
Whole thread Raw
In response to pgsql: Test pg_atomic_fetch_add_ with variable addend and 16-bit edgec  (Noah Misch <noah@leadboat.com>)
Responses Re: pgsql: Test pg_atomic_fetch_add_ with variable addend and 16-bitedge c
List 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



pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix bogus sizeof calculations.
Next
From: Noah Misch
Date:
Subject: Re: pgsql: Test pg_atomic_fetch_add_ with variable addend and 16-bitedge c