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

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: ranier(dot)vf(at)gmail(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fix gcc warning in sync.c (usr/src/backend/storage/sync/sync.c)
Date: 2022-07-11 05:35:00
Message-ID: 20220711.143500.1660612605708077512.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Sat, 9 Jul 2022 21:53:31 -0300, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote in
> sync.c: In function ‘RememberSyncRequest’:
> sync.c:528:10: warning: assignment to ‘PendingFsyncEntry *’ {aka ‘struct
> <anonymous> *’} from incompatible pointer type ‘PendingUnlinkEntry *’ {aka
> ‘struct <anonymous> *’} [-Wincompatible-pointer-types]
> 528 | entry = (PendingUnlinkEntry *) lfirst(cell);
>
> Although the structures are identical, gcc bothers to assign a pointer from
> one to the other.

If the entry were of really PendingSyncEntry, it would need a fix, but
at the same time everyone should see the same warning at their hand.

Actually, I already see the following line (maybe) at the place instead.

529(at)master,REL14, 508(at)REL13
> PendingUnlinkEntry *entry = (PendingUnlinkEntry *) lfirst(cell);

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2022-07-11 05:39:48 Re: NAMEDATALEN increase because of non-latin languages
Previous Message Thomas Munro 2022-07-11 04:50:25 Re: pgsql: dshash: Add sequential scan support.