Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p - Mailing list pgsql-committers

From David Rowley
Subject Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p
Date
Msg-id CAApHDvp-WCUTDU767Lpjw3m698gS+mCrNAnTEppZiXixneVxGQ@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p
List pgsql-committers
On Thu, 17 Jul 2025 at 15:19, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> David Rowley <dgrowleyml@gmail.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

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p
Next
From: Tom Lane
Date:
Subject: Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p