summaryrefslogtreecommitdiff
path: root/include/fortify-headers.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/fortify-headers.h')
-rw-r--r--include/fortify-headers.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/fortify-headers.h b/include/fortify-headers.h
index 5be4271..3eaed7c 100644
--- a/include/fortify-headers.h
+++ b/include/fortify-headers.h
@@ -123,6 +123,15 @@
123 123
124#endif /* __has_attribute */ 124#endif /* __has_attribute */
125 125
126//TODO(jvoisin) Add a check for overflows
127/* check if pointers are overlapping but not if dst == src,
128 * since gcc seems to like to generate code that relies on dst == src */
129#define __fh_overlap(a, b, l) \
130 ( \
131 ((a) < (b) && (b) < (a) + (size_t)(l)) \
132 || ((b) < (a) && (a) < (b) + (size_t)(l)) \
133 )
134
126/* 135/*
127 * We're not making use of C23's <stdckdint.h> since: 136 * We're not making use of C23's <stdckdint.h> since:
128 * - there is no elegant way to make it ignore the results. 137 * - there is no elegant way to make it ignore the results.