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

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p
Дата
Msg-id dc9665a8-987a-443d-ab18-f9865d21d034@eisentraut.org
обсуждение исходный текст
Ответ на Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p
Список 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 по дате отправления: