X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftlist%2Ftest%2Fcompile_fail-tlist_top.c;h=21651400ef0d94bf7cf6d2f7c9a55fdd0399b2dc;hp=622a5781532f583fd18e3645312327ad50950541;hb=03f100b281441a953d4ec858389f82e25a95c043;hpb=c89f34afdc6c2a98c75130470ea0b7f531a3cfe0 diff --git a/ccan/tlist/test/compile_fail-tlist_top.c b/ccan/tlist/test/compile_fail-tlist_top.c index 622a5781..21651400 100644 --- a/ccan/tlist/test/compile_fail-tlist_top.c +++ b/ccan/tlist/test/compile_fail-tlist_top.c @@ -16,20 +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; }