summaryrefslogtreecommitdiff
path: root/ccan/str/test/compile_fail-strchr.c
diff options
context:
space:
mode:
authorWilliam Casarin <jb55@jb55.com>2018-07-09 12:10:32 -0700
committerWilliam Casarin <jb55@jb55.com>2018-07-09 12:10:32 -0700
commit1b8fbbd843ddeb5fc81c9303db9c590a436d499b (patch)
treea7227dfe8e4fbaee7b1e0b58b24994dce8078f3f /ccan/str/test/compile_fail-strchr.c
parent37a9cdd2e80386f2c94e14e4f511284ae14c745a (diff)
progress
Diffstat (limited to 'ccan/str/test/compile_fail-strchr.c')
-rw-r--r--ccan/str/test/compile_fail-strchr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/ccan/str/test/compile_fail-strchr.c b/ccan/str/test/compile_fail-strchr.c
new file mode 100644
index 0000000..bdaf034
--- /dev/null
+++ b/ccan/str/test/compile_fail-strchr.c
@@ -0,0 +1,18 @@
+#define CCAN_STR_DEBUG 1
+#include <ccan/str/str.h>
+
+int main(void)
+{
+#ifdef FAIL
+#if !HAVE_TYPEOF
+ #error We need typeof to check strstr.
+#endif
+#else
+ const
+#endif
+ char *ret;
+ const char *str = "hello";
+
+ ret = strchr(str, 'l');
+ return ret ? 0 : 1;
+}