]> git.ozlabs.org Git - ccan/blobdiff - ccan/asort/test/compile_fail-context-type.c
New asort routine; unf. breaks under -Wmissing-prototypes etc :(
[ccan] / ccan / asort / test / compile_fail-context-type.c
diff --git a/ccan/asort/test/compile_fail-context-type.c b/ccan/asort/test/compile_fail-context-type.c
new file mode 100644 (file)
index 0000000..62d16c5
--- /dev/null
@@ -0,0 +1,21 @@
+#include <ccan/asort/asort.h>
+#include <ccan/asort/asort.c>
+
+static int cmp(char *const *a, char *const *b, int *flag)
+{
+       return 0;
+}
+
+int main(int argc, char **argv)
+{
+#ifdef FAIL
+       char flag;
+#if !HAVE_TYPEOF
+#error "Unfortunately we don't fail if no typeof."
+#endif
+#else
+       int flag;
+#endif
+       asort(argv+1, argc-1, cmp, &flag);
+       return 0;
+}