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

From Andres Freund
Subject Re: Annoying warning in SerializeClientConnectionInfo
Date
Msg-id jtpkpnn4wds6hxi3sde5wwzkn5g3rcmjva6a4wagca5tu5c6j2@myis4xpnjkwv
Whole thread Raw
In response to Re: Annoying warning in SerializeClientConnectionInfo  (Jacob Champion <jacob.champion@enterprisedb.com>)
Responses Re: Annoying warning in SerializeClientConnectionInfo
List pgsql-hackers
Hi,

On 2025-08-11 16:30:30 -0700, Jacob Champion wrote:
> 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?

It's somewhat odd.


> 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.

I think it'd be fine to error out here. For many asserts we don't want them in
real builds because they'd (in very small increments) make the code slower and
bigger. But this is very very far from a hot path...

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Adding basic NUMA awareness
Next
From: Benoit Tigeot
Date:
Subject: pg_stat_statements: Add `calls_aborted` counter for tracking query cancellations