]> git.ozlabs.org Git - ccan/commitdiff
Makefile: add -Wshadow=local, fix configurator!
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 18 Jul 2022 12:28:20 +0000 (21:58 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 18 Jul 2022 12:28:20 +0000 (21:58 +0930)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Makefile
tools/configurator/configurator.c

index d53e89f4d1ca9556e64187e4d3a1a63272b64c74..875e99f2146616ce41abb8bcdb6813ebdb50a53f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ all::
 
 # Our flags for building
 WARN_CFLAGS := -Wall -Wstrict-prototypes -Wold-style-definition -Wundef \
- -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings
+ -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings -Wshadow=local
 DEP_CFLAGS = -MMD -MP -MF$(@:%=%.d) -MT$@
 CCAN_CFLAGS := -g3 -ggdb $(WARN_CFLAGS) -DCCAN_STR_DEBUG=1 -I. $(CFLAGS)
 CFLAGS_FORCE_C_SOURCE := -x c
index 57779f29905b68d82e537e8c4f0c49c2d282ebec..f830cbca14eb3eb3a2f4070fc6564674a0428d2d 100644 (file)
@@ -797,12 +797,12 @@ static bool run_test(const char *cmd, const char *wrapper, struct test *test)
                /* We run INSIDE_MAIN tests for sanity checking. */
                if (strstr(test->style, "EXECUTE")
                    || strstr(test->style, "INSIDE_MAIN")) {
-                       char *cmd = malloc(strlen(wrapper) + strlen(" ." DIR_SEP OUTPUT_FILE) + 1);
+                       char *runcmd = malloc(strlen(wrapper) + strlen(" ." DIR_SEP OUTPUT_FILE) + 1);
 
-                       strcpy(cmd, wrapper);
-                       strcat(cmd, " ." DIR_SEP OUTPUT_FILE);
-                       output = run(cmd, &status);
-                       free(cmd);
+                       strcpy(runcmd, wrapper);
+                       strcat(runcmd, " ." DIR_SEP OUTPUT_FILE);
+                       output = run(runcmd, &status);
+                       free(runcmd);
                        if (!strstr(test->style, "EXECUTE") && status != 0)
                                c12r_errx(EXIT_BAD_TEST,
                                          "Test for %s failed with %i:\n%s",