mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-12 10:04:14 +02:00
bb7e1724a9
These three objects can be created as constants at compile time using specialized macros. Unfortunately since the values assigned are also const, cast-qual complained about the cost qualifier being lost. Fix this by creating new structures to be used just for creating these constants. This is not ideal due to the need to keep the duplicated structures in sync, but in practice these structures are almost never modified. Testing should catch any out of sync structures and this feature is valuable enough to keep even though in theory there could be memory safety issues. In practice the APIs prevent const objects from being used in an unsafe way and testing provides a fair assurance of safety. Writing to these consts would be a fatal error even if it did not cause a segfault. Ideally, we would be able to use warning suppression in these macros to avoid the extra struct, but due to the way they are used it is not possible to add the required pragmas (even using _Pragma). Finally this construction makes it obvious that something special is being done, rather than it being under the covers. |
||
---|---|---|
.. | ||
certificate | ||
code-count | ||
data | ||
lib/pgBackRestTest/Common | ||
src | ||
.gitignore | ||
ci.pl | ||
container.yaml | ||
define.yaml | ||
Dockerfile | ||
test.pl | ||
uncrustify.cfg | ||
Vagrantfile |