1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00
pgbackrest/test/lib/pgBackRestTest
David Steele 76b88a3cd5 Add UNCONSTIFY() macro.
Allows casting const-ness away from an expression, but doesn't allow changing the type. Enforcement of the latter currently only works for gcc-like compilers.

Note that it is not safe to cast const-ness away if the result will ever be modified (it would be undefined behavior). Doing so can cause compiler mis-optimizations or runtime crashes (by modifying read-only memory). It is only safe to use when the result will not be modified, but API design or language restrictions prevent you from declaring that (e.g. because a function returns both const and non-const variables).

Note that this only works in function scope, not for global variables (it would be nice, but not trivial, to improve that).

UNCONSTIFY() requires static assert which is a feature in its own right.
2020-04-02 16:58:38 -04:00
..
Common Add UNCONSTIFY() macro. 2020-04-02 16:58:38 -04:00
Env Fix backup-prior for diff backups in mock/expire integration test. 2020-03-25 15:47:03 -04:00
Module Fix race condition in real/all integration tests. 2020-03-26 15:30:59 -04:00
LibCAuto.pm Add --dry-run option to the expire command. 2020-03-16 13:56:52 -04:00