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

Smith, Peter <peters@fast.au.fujitsu.com>

From: "Smith, Peter" <peters@fast.au.fujitsu.com>
To: Andres Freund <andres@anarazel.de>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-10-28T00:30:11Z
Lists: pgsql-hackers

Attachments

From: Andres Freund <andres@anarazel.de> Sent: Sunday, 27 October 2019 12:03 PM
> My proposal for this really was just to use this as a fallback for when static assert isn't available. Which in turn I was just suggesting because Tom wanted a fallback.

The patch is updated to use "extern" technique only when  "_Static_assert" is unavailable.

PSA.

Kind Regards,
---
Peter Smith
Fujitsu Australia

Commits

  1. Add declaration-level assertions for compile-time checks

  2. Add support for static assertions in C++