RE: Proposal: Add more compile-time asserts to expose inconsistencies.

From: "Smith, Peter" <peters(at)fast(dot)au(dot)fujitsu(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "peter(dot)eisentraut(at)2ndquadrant(dot)com" <peter(dot)eisentraut(at)2ndquadrant(dot)com>, "tgl(at)sss(dot)pgh(dot)pa(dot)us" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "ilmari(at)ilmari(dot)org" <ilmari(at)ilmari(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Proposal: Add more compile-time asserts to expose inconsistencies.
Date: 2019-11-27 12:23:33
Message-ID: 201DD0641B056142AC8C6645EC1B5F62014B9C3649@SYD1217
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> It seems to me that there is a good point to be consistent with the treatment of StaticAssertStmt and StaticAssertExpr in c.h, which have fallback implementations in *all* the configurations supported.

Consistency is good, but:

* That is beyond the scope for what I wanted my patch to achieve; my use-cases are C code only

* It is too risky for me to simply cut/paste my C version of StaticAssertDecl and hope it will work OK for C++. It needs lots of testing because there seems evidence that bad things can happen. E.g. Peter Eisentraut wrote "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 am happy if somebody else with more ability to test C++ properly wants to add the __cplusplus variant of the new macro.

Meanwhile, I've attached latest re-based version of this patch.

Kind Regards.
--
Peter Smith
Fujitsu Australia

Attachment Content-Type Size
ct_asserts_StaticAssertDecl_4.patch application/octet-stream 7.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-11-27 12:25:55 Re: [HACKERS] Block level parallel vacuum
Previous Message Rafia Sabih 2019-11-27 12:12:35 Re: How to prohibit parallel scan through tableam?