X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftlist%2Ftest%2Fcompile_fail-tlist_top.c;h=21651400ef0d94bf7cf6d2f7c9a55fdd0399b2dc;hp=d02c3add7a2e0a4fb780527e63e433a519510d38;hb=6abc867fce8c3eba40eb26092d31e34b47dd9165;hpb=f27c9672ef62379e09793dcf42725bf9c37f44bf diff --git a/ccan/tlist/test/compile_fail-tlist_top.c b/ccan/tlist/test/compile_fail-tlist_top.c index d02c3add..21651400 100644 --- a/ccan/tlist/test/compile_fail-tlist_top.c +++ b/ccan/tlist/test/compile_fail-tlist_top.c @@ -16,21 +16,16 @@ int main(int argc, char *argv[]) { struct tlist_children children; struct child child = { "child" }; - void *c; +#ifdef FAIL + struct cousin *c; +#else + struct child *c; +#endif tlist_init(&children); tlist_add(&children, &child, list); - c = tlist_top(&children, -#ifdef FAIL -#if !HAVE_FLEXIBLE_ARRAY_MEMBER -#error Need flexible array members to check type -#endif - struct cousin, -#else - struct child, -#endif - list); + c = tlist_top(&children, list); (void) c; /* Suppress unused-but-set-variable warning. */ return 0; }