X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fconfigurator%2Fconfigurator.c;h=75c59f86db947263b2a0aa190d8119cfee3934b4;hb=c455d55526c0f15a8b54ecc7bbaf282b01c48ad0;hp=0252fc1ce8901992649cf8a80ffcaf6684bf153f;hpb=3c95fa61256fc559c2cd235caee10046e7464b68;p=ccan diff --git a/tools/configurator/configurator.c b/tools/configurator/configurator.c index 0252fc1c..75c59f86 100644 --- a/tools/configurator/configurator.c +++ b/tools/configurator/configurator.c @@ -68,7 +68,7 @@ struct test { }; static struct test tests[] = { - { "HAVE_32BIT_OFF_T", DEFINES_EVERYTHING|EXECUTE, NULL, NULL, + { "HAVE_32BIT_OFF_T", DEFINES_EVERYTHING|EXECUTE|MAY_NOT_COMPILE, NULL, NULL, "#include \n" "int main(void) {\n" " return sizeof(off_t) == 4 ? 0 : 1;\n" @@ -173,7 +173,7 @@ static struct test tests[] = { { "HAVE_COMPOUND_LITERALS", INSIDE_MAIN, NULL, NULL, "int *foo = (int[]) { 1, 2, 3, 4 };\n" "return foo[0] ? 0 : 1;" }, - { "HAVE_FCHDIR", DEFINES_EVERYTHING|EXECUTE, NULL, NULL, + { "HAVE_FCHDIR", DEFINES_EVERYTHING|EXECUTE|MAY_NOT_COMPILE, NULL, NULL, "#include \n" "#include \n" "#include \n" @@ -194,7 +194,7 @@ static struct test tests[] = { " if (arg == 4)\n" " warnx(\"warn %u\", arg);\n" "}\n" }, - { "HAVE_FILE_OFFSET_BITS", DEFINES_EVERYTHING|EXECUTE, + { "HAVE_FILE_OFFSET_BITS", DEFINES_EVERYTHING|EXECUTE|MAY_NOT_COMPILE, "HAVE_32BIT_OFF_T", NULL, "#define _FILE_OFFSET_BITS 64\n" "#include \n" @@ -202,8 +202,9 @@ static struct test tests[] = { " return sizeof(off_t) == 8 ? 0 : 1;\n" "}\n" }, { "HAVE_FOR_LOOP_DECLARATION", INSIDE_MAIN, NULL, NULL, - "for (int i = 0; i < argc; i++) { return 0; };\n" - "return 1;" }, + "int ret = 1;\n" + "for (int i = 0; i < argc; i++) { ret = 0; };\n" + "return ret;" }, { "HAVE_FLEXIBLE_ARRAY_MEMBER", OUTSIDE_MAIN, NULL, NULL, "struct foo { unsigned int x; int arr[]; };" }, { "HAVE_GETPAGESIZE", DEFINES_FUNC, NULL, NULL, @@ -240,7 +241,7 @@ static struct test tests[] = { "static void *func(int fd) {\n" " return mmap(0, 65536, PROT_READ, MAP_SHARED, fd, 0);\n" "}" }, - { "HAVE_PROC_SELF_MAPS", DEFINES_EVERYTHING|EXECUTE, NULL, NULL, + { "HAVE_PROC_SELF_MAPS", DEFINES_EVERYTHING|EXECUTE|MAY_NOT_COMPILE, NULL, NULL, "#include \n" "#include \n" "#include \n" @@ -325,7 +326,7 @@ static struct test tests[] = { "-Werror -fopenmp" }, { "HAVE_VALGRIND_MEMCHECK_H", OUTSIDE_MAIN, NULL, NULL, "#include \n" }, - { "HAVE_UCONTEXT", DEFINES_EVERYTHING|EXECUTE, + { "HAVE_UCONTEXT", DEFINES_EVERYTHING|EXECUTE|MAY_NOT_COMPILE, NULL, NULL, "#include \n" "static int x = 0;\n" @@ -346,7 +347,7 @@ static struct test tests[] = { " return (x == 3) ? 0 : 1;\n" "}\n" }, - { "HAVE_POINTER_SAFE_MAKECONTEXT", DEFINES_EVERYTHING|EXECUTE, + { "HAVE_POINTER_SAFE_MAKECONTEXT", DEFINES_EVERYTHING|EXECUTE|MAY_NOT_COMPILE, "HAVE_UCONTEXT", NULL, "#include \n" "#include \n" @@ -489,7 +490,7 @@ static bool run_test(const char *cmd, struct test *test) char *dep; /* Space-separated dependencies, could be ! for inverse. */ - while ((len = strcspn(deps, " "))) { + while ((len = strcspn(deps, " ")) != 0) { bool positive = true; if (deps[len]) { dep = strdup(deps);