On Thu, 17 Jul 2025 at 15:19, Tom Lane <t...@sss.pgh.pa.us> wrote: > > David Rowley <dgrowle...@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/
v1-0001-Detect-elog-ERROR-can-t-return-in-MSVC-when-using.patch
Description: Binary data