]> git.ozlabs.org Git - ccan/blobdiff - ccan/container_of/test/compile_fail-var-types.c
cast, container_of, tlist: Fix warning with GCC 4.6: -Wunused-but-set-variable
[ccan] / ccan / container_of / test / compile_fail-var-types.c
index f9312b69b3a0486f0b07506781638c3e09cfce89..f254d9210207fabfd3eedc69062516b0ccafc64e 100644 (file)
@@ -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;
 }