]> git.ozlabs.org Git - ccan/commitdiff
Fix HAVE_ASPRINTF detection
authorKamil <kamilcukrowski@gmail.com>
Fri, 6 Apr 2018 23:00:42 +0000 (01:00 +0200)
committerGitHub <noreply@github.com>
Fri, 6 Apr 2018 23:00:42 +0000 (01:00 +0200)
gcc6 introduceed a new warning switched with -Wmisleading-identation. This caused to generate a compilation warning for if statement misleadingly indented, which caused HAVE_ASPRINTF to be defined as 0. Adding newline after an if statement fixes the problem.

tools/configurator/configurator.c

index ecf8f9f5f1de805c9e6327fa4bacaa0185861d3d..2e5b09c2b984c252c8a2bfd9a397960af057c344 100644 (file)
@@ -102,7 +102,8 @@ static struct test tests[] = {
          "#include <stdio.h>\n"
          "static char *func(int x) {"
          "     char *p;\n"
-         "     if (asprintf(&p, \"%u\", x) == -1) p = NULL;"
+         "     if (asprintf(&p, \"%u\", x) == -1) \n"
+         "             p = NULL;\n"
          "     return p;\n"
          "}" },
        { "HAVE_ATTRIBUTE_COLD", DEFINES_FUNC, NULL, NULL,