Re: undersized unions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: undersized unions
Date
Msg-id 2346143.1675574215@sss.pgh.pa.us
Whole thread Raw
In response to Re: undersized unions  (Michael Paquier <michael@paquier.xyz>)
Responses Re: undersized unions
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Sat, Feb 04, 2023 at 05:07:08AM -0800, Andres Freund wrote:
>> We actually have a fair amount of code like that, but currently are
>> escaping most of the warnings, because gcc doesn't know that palloc() is
>> an allocator. With more optimizations (particularly with LTO), we end up
>> with more of such warnings.  I'd like to annotate palloc so gcc
>> understands the size, as that does help to catch bugs when confusing the
>> type. It also helps static analyzers.

> Ah, that seems like a good idea in the long run.

I'm kind of skeptical about whether we'll be able to get rid of all
the resulting warnings without extremely invasive (and ugly) changes.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: File descriptors in exec'd subprocesses
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: psql: psql variable BACKEND_PID