Re: Fix gcc warning in sync.c (usr/src/backend/storage/sync/sync.c)

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: Fix gcc warning in sync.c (usr/src/backend/storage/sync/sync.c)
Дата
Msg-id CA+hUKGKCkca1Yp3xey52xdFwWXnJRQM-=0kVwQE8iHE8eTvzJA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fix gcc warning in sync.c (usr/src/backend/storage/sync/sync.c)  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: Fix gcc warning in sync.c (usr/src/backend/storage/sync/sync.c)  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
On Mon, Jul 11, 2022 at 9:45 PM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
> At Mon, 11 Jul 2022 01:45:16 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote in
> > Kyotaro Horiguchi <horikyota.ntt@gmail.com> writes:
> > > At Sat, 9 Jul 2022 21:53:31 -0300, Ranier Vilela <ranier.vf@gmail.com> wrote in
> > >> 528 |    entry = (PendingUnlinkEntry *) lfirst(cell);
> >
> > > Actually, I already see the following line (maybe) at the place instead.
> > >> PendingUnlinkEntry *entry = (PendingUnlinkEntry *) lfirst(cell);
> >
> > Yeah, I see no line matching that in HEAD either.

Confusing report :-)

> > However, I do not much like the code at line 528, because its
> > "PendingUnlinkEntry *entry" is masking an outer variable
> > "PendingFsyncEntry *entry" from line 513.  We should rename
> > one or both variables to avoid that masking.

Fair point.

> I thought the same at the moment looking this.  In this case, changing
> entry->syncent, unl(del)lent works. But at the same time I don't think
> that can be strictly applied.

Yeah, let's rename both of them.  Done.

> So, for starters, I compiled the whole tree with -Wshadow=local. and I
> saw many warnings with it.  At a glance all of them are reasonably
> "fixed" but I don't think it is what we want...

Wow, yeah.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: enable/disable broken for statement triggers on partitioned tables
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: EINTR in ftruncate()