From ef54ea44cc261a59bf2d4b5f9898c89da409859d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 22 Mar 2011 12:06:40 +1030 Subject: [PATCH] array_size: make sure tests work even without GCC features. In this case, "work" means "fail to compile cleanly". --- ccan/array_size/test/compile_fail-function-param.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ccan/array_size/test/compile_fail-function-param.c b/ccan/array_size/test/compile_fail-function-param.c index 283646f8..cb64d984 100644 --- a/ccan/array_size/test/compile_fail-function-param.c +++ b/ccan/array_size/test/compile_fail-function-param.c @@ -10,6 +10,9 @@ int check_parameter(const struct foo array[4]) { #ifdef FAIL return (ARRAY_SIZE(array) == 4); +#if !HAVE_TYPEOF || !HAVE_BUILTIN_TYPES_COMPATIBLE_P +#error "Unfortunately we don't fail if _array_size_chk is a noop." +#endif #else return sizeof(array) == 4 * sizeof(struct foo); #endif -- 2.39.2