Michael Paquier <mich...@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