Re: Change copyObject() to use typeof_unqual - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Change copyObject() to use typeof_unqual
Date
Msg-id CAD21AoAN5TJqq9+GiJBEd31x0ssTGdsQHJRBS9QyL7jgR71bgg@mail.gmail.com
Whole thread Raw
In response to Re: Change copyObject() to use typeof_unqual  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Change copyObject() to use typeof_unqual
List pgsql-hackers
Hi,

On Mon, Mar 16, 2026 at 8:32 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Jelte Fennema-Nio <postgres@jeltef.nl> writes:
> > On Mon, 16 Mar 2026 at 13:47, Peter Eisentraut <peter@eisentraut.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



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Proposal: Prevent Primary/Standby SLRU divergence during MultiXact truncation
Next
From: Tomas Vondra
Date:
Subject: Re: pg_stat_io_histogram