X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftlist%2Ftest%2Fcompile_fail-tlist_tail.c;h=48f394446e076421c307dddcf2c1a70e91683d79;hp=ab43ae90d38ca7ac2312e26343d54358416659e8;hb=6abc867fce8c3eba40eb26092d31e34b47dd9165;hpb=c89f34afdc6c2a98c75130470ea0b7f531a3cfe0 diff --git a/ccan/tlist/test/compile_fail-tlist_tail.c b/ccan/tlist/test/compile_fail-tlist_tail.c index ab43ae90..48f39444 100644 --- a/ccan/tlist/test/compile_fail-tlist_tail.c +++ b/ccan/tlist/test/compile_fail-tlist_tail.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_tail(&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_tail(&children, list); + (void) c; /* Suppress unused-but-set-variable warning. */ return 0; }