Re: Type assertions without GCC builtins

From: "Jelte Fennema-Nio" <postgres(at)jeltef(dot)nl>
To: "Peter Eisentraut" <peter(at)eisentraut(dot)org>
Cc: "Thomas Munro" <thomas(dot)munro(at)gmail(dot)com>, "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Type assertions without GCC builtins
Date: 2025-12-09 14:45:43
Message-ID: DETRMJMKIDM8.3BE573TTUBI04@jeltef.nl
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 9 Dec 2025 at 13:43, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl> wrote:
> You mean use const_cast in c++ instead of a C-style cast? Would you
> still want to keep the static asserts.

I now understand that you meant to not remove these lines:
-#if defined(__cplusplus)
-#define unconstify(underlying_type, expr) const_cast<underlying_type>(expr)
-#define unvolatize(underlying_type, expr) const_cast<underlying_type>(expr)

So like the attached. I think that makes sense.

Attachment Content-Type Size
v2-0001-Add-pg_expr_has_type_p-for-type-check-assertions.patch text/x-patch 9.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2025-12-09 15:11:21 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Daniel Gustafsson 2025-12-09 14:37:39 Re: [PATCH] Update comment in nodeBitmapHeapscan.c