Re: pgsql: Don't initialize page in {vm,fsm}_extend(), not needed

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Don't initialize page in {vm,fsm}_extend(), not needed
Date: 2023-04-06 00:55:41
Message-ID: 20230406005541.gowqgqd7uzbwnhqn@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Hi,

On 2023-04-05 16:58:41 -0700, Andres Freund wrote:
> On 2023-04-05 19:19:48 -0400, Tom Lane wrote:
> > Andres Freund <andres(at)anarazel(dot)de> writes:
> > > Don't initialize page in {vm,fsm}_extend(), not needed
> >
> > Various buildfarm members are complaining about under-braced
> > initializations added by this commit.
> >
> > visibilitymap.c: In function \342\200\230vm_extend\342\200\231:
> > visibilitymap.c:625:2: warning: missing braces around initializer [-Wmissing-braces]
> > PGAlignedBlock pg = {0};
> > ^
> > visibilitymap.c:625:2: warning: (near initialization for \342\200\230pg.data\342\200\231) [-Wmissing-braces]
> >
> > freespace.c: In function \342\200\230fsm_extend\342\200\231:
> > freespace.c:611:2: warning: missing braces around initializer [-Wmissing-braces]
> > PGAlignedBlock pg = {0};
> > ^
> > freespace.c:611:2: warning: (near initialization for \342\200\230pg.data\342\200\231) [-Wmissing-braces]
> >
> > This is from buri, similar from curculio, dragonet, idiacanthus,
> > xenodermus, etc
>
> I really don't see the point of placating old compilers for things like
> this. It's just inflicting pain on ourselves without any reward. Just to be
> clear: I didn't knowingly trigger the warning.
>
> Either way, an upcoming commit will implement vm_extend() / fsm_extend() with
> generic code, then the warning will be gone.

Done as of fcdda1e4b50249c344e510ea93d4bd74d2743430

- Andres

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2023-04-06 02:00:54 pgsql: Convert many uses of ReadBuffer[Extended](P_NEW) to ExtendBuffer
Previous Message Andres Freund 2023-04-06 00:51:23 pgsql: Use ExtendBufferedRelTo() in {vm,fsm}_extend()