Re: Change copyObject() to use typeof_unqual

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change copyObject() to use typeof_unqual
Date: 2026-03-16 22:28:07
Message-ID: CAD21AoAN5TJqq9+GiJBEd31x0ssTGdsQHJRBS9QyL7jgR71bgg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Mar 16, 2026 at 8:32 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Jelte Fennema-Nio <postgres(at)jeltef(dot)nl> writes:
> > On Mon, 16 Mar 2026 at 13:47, Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
> >> I'm tempted to go with my proposed patch of a version-based override for
> >> the time being.
>
> > Sounds good to me.
>
> I confirmed that Peter's
> 0001-Hardcode-override-of-typeof_unqual-for-clang-for-bit.patch
> fixes the problem on my Fedora 40 system.

I'm still encountering the following error while building from source
at commit f4af7849b3d when using autoconf:

execParallel.c:154:9: error: call to undeclared function
'typeof_unqual'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
154 | plan = copyObject(plan);
| ^
../../../src/include/nodes/nodes.h:230:27: note: expanded from macro
'copyObject'
230 | #define copyObject(obj) ((typeof_unqual(*(obj)) *) copyObjectImpl(obj))
| ^
execParallel.c:154:9: error: expected expression
../../../src/include/nodes/nodes.h:230:50: note: expanded from macro
'copyObject'
230 | #define copyObject(obj) ((typeof_unqual(*(obj)) *) copyObjectImpl(obj))
| ^
analyze.c:3213:27: error: call to undeclared function 'typeof_unqual';
ISO C99 and later do not support implicit function declarations
[-Wimplicit-function-declaration]
3213 | stmt->into->viewQuery = copyObject(query);
| ^
../../../src/include/nodes/nodes.h:230:27: note: expanded from macro
'copyObject'
230 | #define copyObject(obj) ((typeof_unqual(*(obj)) *) copyObjectImpl(obj))
| ^
analyze.c:3213:27: error: expected expression
../../../src/include/nodes/nodes.h:230:50: note: expanded from macro
'copyObject'
230 | #define copyObject(obj) ((typeof_unqual(*(obj)) *) copyObjectImpl(obj))
| ^
2 errors generated.
:
(many similar errors)

I'm using Fedora 43 and gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7).
The issue doesn't happen when using meson+ninja.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-03-16 22:50:28 Re: pg_stat_io_histogram
Previous Message Heikki Linnakangas 2026-03-16 22:10:41 Re: Proposal: Prevent Primary/Standby SLRU divergence during MultiXact truncation