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

From Peter Eisentraut
Subject Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p
Date
Msg-id dc9665a8-987a-443d-ab18-f9865d21d034@eisentraut.org
Whole thread Raw
In response to Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p
List pgsql-committers
On 12.03.25 09:37, David Rowley wrote:
> On Wed, 12 Mar 2025 at 21:15, Peter Eisentraut <peter@eisentraut.org> wrote:
>>
>> On 12.03.25 03:08, David Rowley wrote:
>>> This introduces a new compiler warning for compilers that don't know
>>> the ereport(ERROR) does not return.
>>
>> Which compiler is that?
> 
> C:\Users\drowley\pg_src>cl
> Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34808 for x64
> Copyright (C) Microsoft Corporation.  All rights reserved.
> 
> I suspect drongo will also show the same warning once it runs on the
> latest commit shortly.

Ok, this is weird, because we have pg_unreachable() support for MSVC:

#if defined(HAVE__BUILTIN_UNREACHABLE) && !defined(USE_ASSERT_CHECKING)
#define pg_unreachable() __builtin_unreachable()
#elif defined(_MSC_VER) && !defined(USE_ASSERT_CHECKING)
#define pg_unreachable() __assume(0)
#else
#define pg_unreachable() abort()
#endif

Is there a way to reshuffle those conditionals to make this actually do 
something useful on MSVC?

Are you compiling with assertions on in this case?  Does anything change 
about this if you don't use assertions (or vice versa)?



pgsql-committers by date:

Previous
From: Richard Guo
Date:
Subject: pgsql: Remove code setting wrap_non_vars to true for UNION ALL subqueri
Next
From: Peter Eisentraut
Date:
Subject: pgsql: pg_noreturn to replace pg_attribute_noreturn()