pgsql: In s_lock.h, use regular labels with %= instead of local labels. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: In s_lock.h, use regular labels with %= instead of local labels.
Date
Msg-id E1vmwYc-000l4O-14@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
In s_lock.h, use regular labels with %= instead of local labels.

Up to now we've used GNU-style local labels for branch targets
in s_lock.h's assembly blocks.  But there's an alternative style,
which I for one didn't know about till recently: use regular
assembler labels, and insert a per-asm-block number in them
using %= to ensure they are distinct across multiple TAS calls
within one source file.  gcc has had %= since gcc 2.0, and
I've verified that clang knows it too.

While the immediate motivation for changing this is that AIX's
assembler doesn't do local labels, it seems to me that this is a
superior solution anyway.  There is nothing mnemonic about "1:",
while a regular label can convey something useful, and at least
to me it feels less error-prone.  Therefore let's standardize on
this approach, also converting the one other usage in s_lock.h.

Discussion: https://postgr.es/m/399291.1769998688@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0c9f46c4280e31a4f49200f5d2cde37727651869

Modified Files
--------------
src/include/storage/s_lock.h | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Fix error message in RemoveWalSummaryIfOlderThan()
Next
From: Tom Lane
Date:
Subject: pgsql: Refactor att_align_nominal() to improve performance.