From: Rusty Russell Date: Tue, 22 Mar 2011 01:36:40 +0000 (+1030) Subject: array_size: make sure tests work even without GCC features. X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=ef54ea44cc261a59bf2d4b5f9898c89da409859d array_size: make sure tests work even without GCC features. In this case, "work" means "fail to compile cleanly". --- 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