summaryrefslogtreecommitdiff
path: root/src/common/relpath.c
diff options
context:
space:
mode:
authorMichael Paquier2020-02-03 05:48:42 +0000
committerMichael Paquier2020-02-03 05:48:42 +0000
commitf1f10a1ba9e17e606a7b217ccccdd3cc4d8cb771 (patch)
tree2ad0e6861232bcef32bc0924469de3958b86cdb4 /src/common/relpath.c
parent6148e2b9a6399b77e10e277c32d701b84703820f (diff)
Add declaration-level assertions for compile-time checks
Those new assertions can be used at file scope, outside of any function for compilation checks. This commit provides implementations for C and C++, and fallback implementations. Author: Peter Smith Reviewed-by: Andres Freund, Kyotaro Horiguchi, Dagfinn Ilmari Mannsåker, Michael Paquier Discussion: https://postgr.es/m/201DD0641B056142AC8C6645EC1B5F62014B8E8030@SYD1217
Diffstat (limited to 'src/common/relpath.c')
-rw-r--r--src/common/relpath.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/relpath.c b/src/common/relpath.c
index 91efcedf70d..ad733d13635 100644
--- a/src/common/relpath.c
+++ b/src/common/relpath.c
@@ -37,6 +37,9 @@ const char *const forkNames[] = {
"init" /* INIT_FORKNUM */
};
+StaticAssertDecl(lengthof(forkNames) == (MAX_FORKNUM + 1),
+ "array length mismatch");
+
/*
* forkname_to_number - look up fork number by name
*