pgsql: Fix compilation warning with SerializeClientConnectionInfo()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix compilation warning with SerializeClientConnectionInfo()
Date: 2025-08-14 07:22:22
Message-ID: E1umSI3-000UD9-0k@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix compilation warning with SerializeClientConnectionInfo()

This function uses an argument named "maxsize" that is only used in
assertions, being set once outside the assertion area. Recent gcc
versions with -Wunused-but-set-parameter complain about a warning when
building without assertions enabled, because of that.

In order to fix this issue, PG_USED_FOR_ASSERTS_ONLY is added to the
function argument of SerializeClientConnectionInfo(), which is the first
time we are doing so in the tree. The CI is fine with the change, but
let's see what the buildfarm has to say on the matter.

Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Reviewed-by: Jacob Champion <jchampion(at)postgresql(dot)org>
Discussion: https://postgr.es/m/pevajesswhxafjkivoq3yvwxga77tbncghlf3gq5fvchsvfuda@6uivg25sb3nx
Backpatch-through: 16

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6304256e79c70f6446e840023fbf1cbee47fb08e

Modified Files
--------------
src/backend/utils/init/miscinit.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-08-14 07:22:23 pgsql: Fix compilation warning with SerializeClientConnectionInfo()
Previous Message Fujii Masao 2025-08-14 03:36:00 pgsql: Revert logical snapshot filename format change in SnapBuildSnaps