Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Masahiko Sawada <msawada(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p
Date: 2025-07-17 04:09:18
Message-ID: CAApHDvp-WCUTDU767Lpjw3m698gS+mCrNAnTEppZiXixneVxGQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Thu, 17 Jul 2025 at 15:19, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> > I spent a bit more time searching for a solution and did find
> > something that works well enough for this case in [1]. Unfortunately,
> > it only works with C11. See attached .c file and output below.
>
> Hmph. I doubt we are ready to require C11 everywhere, but maybe
> we could require it in MSVC builds? Which MSVC versions would
> that eliminate?

Going by [1] it's Visual Studio 2019, which as of 8fd9bb1d9 is now our
minimum supported VS version.

I hacked up a quick patch (attached) which compiles without any
warnings. Tested on VS2012 with meson setup -Dc_std=c11.

Unsure what other repercussions there are of compiling with C11 and
have not looked into what it would take to adjust the meson build
scripts to default to that for MSVC builds.

David

[1] https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/

Attachment Content-Type Size
v1-0001-Detect-elog-ERROR-can-t-return-in-MSVC-when-using.patch application/octet-stream 1.8 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-07-17 04:20:30 Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p
Previous Message Tom Lane 2025-07-17 03:19:56 Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p