summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2024-06-14 19:46:14 +0200
committerJulien Voisin2024-06-15 13:46:35 +0000
commit520e7e4a631cc038b3e867b2255235da35a98ece (patch)
treea1ba19a16d1940092334d7df463868f1cfa5e014
parent6939e3382a232d20882c1c7e74274132de154bb6 (diff)
Fix some pointer-arithmetic warnings
This should fix the second part of #59
-rw-r--r--include/fortify-headers.h4
-rw-r--r--tests/Makefile2
2 files changed, 3 insertions, 3 deletions
diff --git a/include/fortify-headers.h b/include/fortify-headers.h
index 796fd2d..f7d8af8 100644
--- a/include/fortify-headers.h
+++ b/include/fortify-headers.h
@@ -141,8 +141,8 @@
141 * since gcc seems to like to generate code that relies on dst == src */ 141 * since gcc seems to like to generate code that relies on dst == src */
142#define __fh_overlap(a, len_a, b, len_b) \ 142#define __fh_overlap(a, len_a, b, len_b) \
143 ( \ 143 ( \
144 ((a) < (b) && (b) < ((a) + (__fh_size_t)(len_a))) \ 144 ((char*)(a) < (char*)(b) && (char*)(b) < ((char*)(a) + (__fh_size_t)(len_a))) \
145 || ((b) < (a) && (a) < ((b) + (__fh_size_t)(len_b))) \ 145 || ((char*)(b) < (char*)(a) && (char*)(a) < ((char*)(b) + (__fh_size_t)(len_b))) \
146 ) 146 )
147 147
148/* 148/*
diff --git a/tests/Makefile b/tests/Makefile
index 32b17b0..d6f5b5d 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,4 +1,4 @@
1CFLAGS+=-I../include/ -D_FORTIFY_SOURCE=3 -static -O2 -DPEDANTIC_CHECKS -Wno-format 1CFLAGS+=-I../include/ -D_FORTIFY_SOURCE=3 -static -O2 -DPEDANTIC_CHECKS -Wno-format -Werror=pointer-arith
2 2
3COMPTIME_TARGETS= \ 3COMPTIME_TARGETS= \
4 test_memcpy_overwrite_under \ 4 test_memcpy_overwrite_under \