Re: Hide exposed impl detail of wchar.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Jubilee Young <workingjubilee(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, John Naylor <johncnaylorls(at)gmail(dot)com>
Subject: Re: Hide exposed impl detail of wchar.c
Date: 2023-11-16 23:06:30
Message-ID: 450044.1700175990@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nathan Bossart <nathandbossart(at)gmail(dot)com> writes:
> It looks like is_valid_ascii() was originally added to pg_wchar.h so that
> it could easily be used elsewhere [0] [1], but that doesn't seem to have
> happened yet.

It seems to be new as of v15, so there wouldn't have been a lot of time
for external code to adopt it. As far as I can tell from Debian Code
Search, nobody has yet.

> Would moving this definition to a separate header file be a viable option?
> That'd still break any existing projects that are using it, but at least
> there'd be an easy fix.

That would provide a little bit of cover, at least, compared to just
hiding it in the .c file.

I'm generally sympathetic to the idea that simd.h was a rather large
dependency to add to something as widely used as pg_wchar.h. So I'd
favor getting it out of there just on compilation-time grounds,
independently of whether it's causing active problems. That argument
wouldn't justify a back-patch, but "it's causing problems" might.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2023-11-16 23:25:33 Re: EXCLUDE COLLATE in CREATE/ALTER TABLE document
Previous Message Nathan Bossart 2023-11-16 22:54:02 Re: Hide exposed impl detail of wchar.c