On 12.03.25 09:37, David Rowley wrote:
On Wed, 12 Mar 2025 at 21:15, Peter Eisentraut <pe...@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)?


Reply via email to