Re: undersized unions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: undersized unions
Date: 2023-02-05 05:16:55
Message-ID: 2346143.1675574215@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(at)paquier(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2023-02-05 05:17:39 Re: proposal: psql: psql variable BACKEND_PID
Previous Message Tom Lane 2023-02-05 05:15:01 Re: File descriptors in exec'd subprocesses