Re: Proposal: Add more compile-time asserts to exposeinconsistencies. - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Proposal: Add more compile-time asserts to exposeinconsistencies.
Date
Msg-id 05762932-98f3-9504-d885-7d690623deed@2ndquadrant.com
Whole thread Raw
In response to Re: Proposal: Add more compile-time asserts to exposeinconsistencies.  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 2019-11-12 20:00, Andres Freund wrote:
> Looking at the cplusplus variant, I'm somewhat surprised to see that you
> made both fallback and plain version unconditionally use GCC style
> compound expressions:

> Was that intentional? The C version intentionally uses compound
> expressions only for the _Static_assert case, where configure tests for
> the compound expression support?  As far as I can tell this'll not allow
> using our headers e.g. with msvc in C++ mode if somebody introduce a
> static assertion in a header - which seems like a likely and good
> outcome with the changes proposed here?

I don't recall all the details anymore, but if you're asking, why is the 
fallback implementation in C++ different from the one in C, then that's 
because the C variant didn't work in C++.

I seem to recall that I did this work in order to get an actual 
C++-using extension to compile, so it worked(tm) at some point, but I 
probably didn't try it with a not-gcc compatible compiler at the time.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Antonin Houska
Date:
Subject: Re: MarkBufferDirtyHint() and LSN update
Next
From: Tom Lane
Date:
Subject: Re: Invisible PROMPT2