Re: Annoying warning in SerializeClientConnectionInfo - Mailing list pgsql-hackers

From Jacob Champion
Subject Re: Annoying warning in SerializeClientConnectionInfo
Date
Msg-id CAOYmi+==sWx4r0LxFP9SFExcuGC8KA3XnivFASoBwB_S2jiXMA@mail.gmail.com
Whole thread Raw
In response to Annoying warning in SerializeClientConnectionInfo  (Andres Freund <andres@anarazel.de>)
Responses Re: Annoying warning in SerializeClientConnectionInfo
Re: Annoying warning in SerializeClientConnectionInfo
List pgsql-hackers
On Mon, Aug 11, 2025 at 3:52 PM Andres Freund <andres@anarazel.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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Annoying warning in SerializeClientConnectionInfo
Next
From: Tom Lane
Date:
Subject: Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected