Andres Freund <and...@anarazel.de> writes: > On 2019-09-19 04:46:27 +0000, Smith, Peter wrote: >> In the attached patch example I have defined a new macro >> StaticAssertDecl. A typical usage of it is shown in the relpath.c >> file.
> I'm in favor of adding that - in fact, when I was working on adding a a > static_assert wrapper, I was advocating for only supporting compilers > that know static_assert, so we can put these in the global scope. The > number of compilers that don't support static_assert is pretty small > today, especially compared to 2012, when we added these. > https://www.postgresql.org/message-id/E1TIW1p-0002yE-AY%40gemulon.postgresql.org > https://www.postgresql.org/message-id/27446.1349024252%40sss.pgh.pa.us > Tom, you were arguing for restricting to file scope to get broader > compatibility, are you ok with adding a seperate *Decl version? It could use another look now that we require C99. I'd be in favor of having a decl-level static assert if practical. regards, tom lane