X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fstr%2Ftest%2Fcompile_fail-strrchr.c;fp=ccan%2Fstr%2Ftest%2Fcompile_fail-strrchr.c;h=ba7d17e031985df303e0f23a85f1421bf4024578;hp=0000000000000000000000000000000000000000;hb=ecea073699c60fd5aab9e3955f59a7042d637b68;hpb=3f4e83d8ac847d6bf0c20e88cdbca535e842a97b diff --git a/ccan/str/test/compile_fail-strrchr.c b/ccan/str/test/compile_fail-strrchr.c new file mode 100644 index 00000000..ba7d17e0 --- /dev/null +++ b/ccan/str/test/compile_fail-strrchr.c @@ -0,0 +1,18 @@ +#define CCAN_STR_DEBUG 1 +#include + +int main(int argc, char *argv[]) +{ +#ifdef FAIL +#if !HAVE_TYPEOF + #error We need typeof to check strstr. +#endif +#else + const +#endif + char *ret; + const char *str = "hello"; + + ret = strrchr(str, 'l'); + return ret ? 0 : 1; +}