summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/htssafe.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/htssafe.h b/src/htssafe.h
index 6e4e84b..ad3513f 100644
--- a/src/htssafe.h
+++ b/src/htssafe.h
@@ -100,6 +100,17 @@ static HTS_UNUSED void abortf_(const char *exp, const char *file, int line) {
#endif
#define HTS_IS_NOT_CHAR_BUFFER(VAR) ( ! HTS_IS_CHAR_BUFFER(VAR) )
+/* Compile-time checks. */
+static HTS_UNUSED void htssafe_compile_time_check_() {
+ char array[32];
+ char *pointer = array;
+ char check_array[HTS_IS_CHAR_BUFFER(array) ? 1 : -1];
+ char check_pointer[HTS_IS_CHAR_BUFFER(pointer) ? -1 : 1];
+ (void) pointer;
+ (void) check_array;
+ (void) check_pointer;
+}
+
/**
* Append at most N characters from "B" to "A".
* If "A" is a char[] variable whose size is not sizeof(char*), then the size