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>, pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p |
Date: | 2025-07-21 00:39:36 |
Message-ID: | CAApHDvqH_gsb4UwHAQGy9w_oJYyB8y-esQbHNUoGsB668RZ9gQ@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
On Thu, 17 Jul 2025 at 16:20, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> > 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.
>
> In theory there should be no repercussions, because we already
> support compiling with C11: C99 is a minimum not a maximum.
Oh, right.
> But I've not checked the meson scripts either.
The attached seems to work.
It's my first time hacking on meson build scripts. I was surprised to
see the "-std=c99" test just does not work for MSVC since the flag is
spelt "/std:c99" for that compiler. The reason it's not causing
trouble is due to the code compiling without that flag, so the test
that passes the flag is never executed. For the test I added, I had
to use the MSVC naming convention, which seems fine as it's only run
when "cc.get_id() == 'msvc'".
I've not gone over the other users of __builtin_constant_p() to
replace them with the pg_builtin_constant(). That's probably a good
exercise to do as I'm not sure how well the MSVC _Generic trick works
or if there might be some expressions it doesn't work with.
I also opted not to have the pg_builtin_constant() macro return 0 when
it's unsupported as I was worred some code might make too many
assumptions about the variability of the expression if that were to
return false. I don't quite have a problem case in mind for that.
Doing it that way was mostly erring on the side of caution.
For now, I've left in a commented out "return NULL;". I get no
compiler warnings from that.
David
Attachment | Content-Type | Size |
---|---|---|
v2-0001-Detect-elog-ERROR-can-t-return-in-MSVC-when-using.patch | application/octet-stream | 4.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Álvaro Herrera | 2025-07-21 09:35:54 | pgsql: pg_dump: include comments on not-null constraints on domains, to |
Previous Message | Fujii Masao | 2025-07-20 03:04:27 | pgsql: doc: Document reopen of output file via SIGHUP in pg_recvlogical |