Re: Annoying warning in SerializeClientConnectionInfo

From: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, Michael Paquier <michael(at)paquier(dot)xyz>, Andy Fan <zhihuifan1213(at)163(dot)com>
Subject: Re: Annoying warning in SerializeClientConnectionInfo
Date: 2025-08-11 23:30:30
Message-ID: CAOYmi+==sWx4r0LxFP9SFExcuGC8KA3XnivFASoBwB_S2jiXMA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 11, 2025 at 3:52 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> And the warning is right. Not sure why a new compiler is needed, IIRC this
> warning is present in other cases with older compilers too.

Probably
https://github.com/gcc-mirror/gcc/commit/0eac9cfee
which was committed last month.

Andy Fan reported this as well [1] but I did not see it at the time.
:( Sorry, Andy, my email had changed.

> The most obvious fix is to slap on a PG_USED_FOR_ASSERTS_ONLY. However, we so
> far don't seem to have used it for function parameters... But I don't see a
> problem with starting to do so.

WFM. Do you have any opinions on our use of maxsize in general? I
think there are other serialization functions that just assert, but it
looks like some are more actively throwing errors if there's not
enough space. Given the subject matter here I'm wondering if we should
take the stricter approach.

Thanks,
--Jacob

[1] https://postgr.es/m/875xyqhzs6.fsf%40163.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-08-11 23:41:07 Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected
Previous Message Andres Freund 2025-08-11 22:52:23 Annoying warning in SerializeClientConnectionInfo