pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Suppress compiler warning in relptr_store().
6+ messages / 1 participants
[nested] [flat]

* pgsql: Suppress compiler warning in relptr_store().
@ 2022-03-26 18:30 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2022-03-26 18:30 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Suppress compiler warning in relptr_store().

clang 13 with -Wextra warns that "performing pointer subtraction with
a null pointer has undefined behavior" in the places where freepage.c
tries to set a relptr variable to constant NULL.  This appears to be
a compiler bug, but it's unlikely to get fixed instantly.  Fortunately,
we can work around it by introducing an inline support function, which
seems like a good change anyway because it removes the macro's existing
double-evaluation hazard.

Backpatch to v10 where this code was introduced.

Patch by me, based on an idea of Andres Freund's.

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e07d4ddc55fdcf82082950b3eb0cd8f728284c9d

Modified Files
--------------
src/include/utils/relptr.h | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Suppress compiler warning in relptr_store().
@ 2022-03-26 18:30 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2022-03-26 18:30 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Suppress compiler warning in relptr_store().

clang 13 with -Wextra warns that "performing pointer subtraction with
a null pointer has undefined behavior" in the places where freepage.c
tries to set a relptr variable to constant NULL.  This appears to be
a compiler bug, but it's unlikely to get fixed instantly.  Fortunately,
we can work around it by introducing an inline support function, which
seems like a good change anyway because it removes the macro's existing
double-evaluation hazard.

Backpatch to v10 where this code was introduced.

Patch by me, based on an idea of Andres Freund's.

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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0144c9c7e73dc75f9cd5297c7c380d55927beb75

Modified Files
--------------
src/include/utils/relptr.h | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Suppress compiler warning in relptr_store().
@ 2022-03-26 18:30 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2022-03-26 18:30 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Suppress compiler warning in relptr_store().

clang 13 with -Wextra warns that "performing pointer subtraction with
a null pointer has undefined behavior" in the places where freepage.c
tries to set a relptr variable to constant NULL.  This appears to be
a compiler bug, but it's unlikely to get fixed instantly.  Fortunately,
we can work around it by introducing an inline support function, which
seems like a good change anyway because it removes the macro's existing
double-evaluation hazard.

Backpatch to v10 where this code was introduced.

Patch by me, based on an idea of Andres Freund's.

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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4fbbea2c1934092581662553fd4be9e84630fc5c

Modified Files
--------------
src/include/utils/relptr.h | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Suppress compiler warning in relptr_store().
@ 2022-03-26 18:30 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2022-03-26 18:30 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Suppress compiler warning in relptr_store().

clang 13 with -Wextra warns that "performing pointer subtraction with
a null pointer has undefined behavior" in the places where freepage.c
tries to set a relptr variable to constant NULL.  This appears to be
a compiler bug, but it's unlikely to get fixed instantly.  Fortunately,
we can work around it by introducing an inline support function, which
seems like a good change anyway because it removes the macro's existing
double-evaluation hazard.

Backpatch to v10 where this code was introduced.

Patch by me, based on an idea of Andres Freund's.

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

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/cb8586d0514bc685152e34b3af3b9a803e4eb9f4

Modified Files
--------------
src/include/utils/relptr.h | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Suppress compiler warning in relptr_store().
@ 2022-03-26 18:30 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2022-03-26 18:30 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Suppress compiler warning in relptr_store().

clang 13 with -Wextra warns that "performing pointer subtraction with
a null pointer has undefined behavior" in the places where freepage.c
tries to set a relptr variable to constant NULL.  This appears to be
a compiler bug, but it's unlikely to get fixed instantly.  Fortunately,
we can work around it by introducing an inline support function, which
seems like a good change anyway because it removes the macro's existing
double-evaluation hazard.

Backpatch to v10 where this code was introduced.

Patch by me, based on an idea of Andres Freund's.

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

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a2a1aa830a1ccf6991c59a64c6f2b873f3c2c727

Modified Files
--------------
src/include/utils/relptr.h | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Suppress compiler warning in relptr_store().
@ 2022-03-26 18:30 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2022-03-26 18:30 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Suppress compiler warning in relptr_store().

clang 13 with -Wextra warns that "performing pointer subtraction with
a null pointer has undefined behavior" in the places where freepage.c
tries to set a relptr variable to constant NULL.  This appears to be
a compiler bug, but it's unlikely to get fixed instantly.  Fortunately,
we can work around it by introducing an inline support function, which
seems like a good change anyway because it removes the macro's existing
double-evaluation hazard.

Backpatch to v10 where this code was introduced.

Patch by me, based on an idea of Andres Freund's.

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

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/403a8c76293bdef17bf5ee8af6be92ee4eba6bb1

Modified Files
--------------
src/include/utils/relptr.h | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2022-03-26 18:30 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-03-26 18:30 pgsql: Suppress compiler warning in relptr_store(). Tom Lane <tgl@sss.pgh.pa.us>
2022-03-26 18:30 pgsql: Suppress compiler warning in relptr_store(). Tom Lane <tgl@sss.pgh.pa.us>
2022-03-26 18:30 pgsql: Suppress compiler warning in relptr_store(). Tom Lane <tgl@sss.pgh.pa.us>
2022-03-26 18:30 pgsql: Suppress compiler warning in relptr_store(). Tom Lane <tgl@sss.pgh.pa.us>
2022-03-26 18:30 pgsql: Suppress compiler warning in relptr_store(). Tom Lane <tgl@sss.pgh.pa.us>
2022-03-26 18:30 pgsql: Suppress compiler warning in relptr_store(). Tom Lane <tgl@sss.pgh.pa.us>

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