X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcontainer_of%2Ftest%2Fcompile_fail-var-types.c;h=f254d9210207fabfd3eedc69062516b0ccafc64e;hb=6a8d296f9383dd25ec381e2ab136a33823d140e5;hp=5c7767985223b62259a7cea1c08c0dd8e60fc630;hpb=650c775ff00cccd03fc84e7789a03c51d9839004;p=ccan diff --git a/ccan/container_of/test/compile_fail-var-types.c b/ccan/container_of/test/compile_fail-var-types.c index 5c776798..f254d921 100644 --- a/ccan/container_of/test/compile_fail-var-types.c +++ b/ccan/container_of/test/compile_fail-var-types.c @@ -1,4 +1,4 @@ -#include "container_of/container_of.h" +#include #include struct foo { @@ -14,8 +14,12 @@ int main(int argc, char *argv[]) #ifdef FAIL /* b is a char, but intp is an int * */ foop = container_of_var(intp, foop, b); +#if !HAVE_TYPEOF +#error "Unfortunately we don't fail if we don't have typeof." +#endif #else foop = NULL; #endif + (void) foop; /* Suppress unused-but-set-variable warning. */ return intp == NULL; }