]> git.ozlabs.org Git - ccan/blobdiff - ccan/array_size/test/compile_fail-function-param.c
array_size: fix spurious test fail with gcc-5
[ccan] / ccan / array_size / test / compile_fail-function-param.c
index 283646f871a771af54893fb4de913e1a7b43340f..48697e044ec797ada4e6c77cddc91159363975db 100644 (file)
@@ -5,11 +5,14 @@ struct foo {
        unsigned int a, b;
 };
 
-int check_parameter(const struct foo array[4]);
-int check_parameter(const struct foo array[4])
+int check_parameter(const struct foo *array);
+int check_parameter(const struct foo *array)
 {
 #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