diff --git a/Makefile b/Makefile index 0d4a39f1..e5817f14 100644 --- a/Makefile +++ b/Makefile @@ -86,7 +86,8 @@ DISABLE_WARNING_FLAGS := $(call cc-disable-warning, format-truncation) \ # Warnings that we want by default ENABLE_WARNING_FLAGS := $(call cc-option, -Wimplicit-fallthrough) \ - $(call cc-option, -Wmissing-prototypes) + $(call cc-option, -Wmissing-prototypes) \ + -Wshadow ASFLAGS = diff --git a/Makefile.extrawarn b/Makefile.extrawarn index 9cd27917..44bc8cff 100644 --- a/Makefile.extrawarn +++ b/Makefile.extrawarn @@ -60,7 +60,6 @@ warning-2 := -Waggregate-return warning-2 += -Wcast-align warning-2 += -Wdisabled-optimization warning-2 += -Wnested-externs -warning-2 += -Wshadow warning-2 += $(call cc-option, -Wlogical-op) warning-2 += $(call cc-option, -Wmissing-field-initializers) warning-2 += $(call cc-option, -Wformat-truncation) diff --git a/tests/fssum.c b/tests/fssum.c index bca33c77..f41daf5c 100644 --- a/tests/fssum.c +++ b/tests/fssum.c @@ -185,9 +185,9 @@ sum_fini(sum_t *cs) } static void -sum_add(sum_t *cs, void *buf, int size) +sum_add(sum_t *cs, void *data, int size) { - SHA256Input(&cs->sha, buf, size); + SHA256Input(&cs->sha, data, size); } static void @@ -235,7 +235,7 @@ sum_xattrs(int fd, sum_t *dst) { ssize_t buflen; ssize_t len; - char *buf; + char *buffer; char *p; char **names = NULL; int num_xattrs = 0; @@ -249,11 +249,11 @@ sum_xattrs(int fd, sum_t *dst) if (buflen == 0) return 0; - buf = malloc(buflen); - if (!buf) + buffer = malloc(buflen); + if (!buffer) return -ENOMEM; - buflen = flistxattr(fd, buf, buflen); + buflen = flistxattr(fd, buffer, buflen); if (buflen < 0) { ret = -errno; goto out; @@ -265,7 +265,7 @@ sum_xattrs(int fd, sum_t *dst) * on different filesystems. */ - p = buf; + p = buffer; len = buflen; while (len > 0) { int keylen; @@ -282,7 +282,7 @@ sum_xattrs(int fd, sum_t *dst) goto out; } - p = buf; + p = buffer; for (i = 0; i < num_xattrs; i++) { names[i] = p; p += strlen(p) + 1; /* +1 for NULL terminator */ @@ -315,7 +315,7 @@ sum_xattrs(int fd, sum_t *dst) free(p); } out: - free(buf); + free(buffer); free(names); return ret;