wintest: add option to select the dns backend
[Samba/gebeck_regimport.git] / lib / ccan / container_of / test / compile_fail-var-types.c
blobf254d9210207fabfd3eedc69062516b0ccafc64e
1 #include <ccan/container_of/container_of.h>
2 #include <stdlib.h>
4 struct foo {
5 int a;
6 char b;
7 };
9 int main(int argc, char *argv[])
11 struct foo foo = { .a = 1, .b = 2 }, *foop;
12 int *intp = &foo.a;
14 #ifdef FAIL
15 /* b is a char, but intp is an int * */
16 foop = container_of_var(intp, foop, b);
17 #if !HAVE_TYPEOF
18 #error "Unfortunately we don't fail if we don't have typeof."
19 #endif
20 #else
21 foop = NULL;
22 #endif
23 (void) foop; /* Suppress unused-but-set-variable warning. */
24 return intp == NULL;