aboutsummaryrefslogtreecommitdiff
path: root/checks.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-02-01 16:41:59 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2014-02-01 16:48:19 +1100
commit24cb3d0681d9196d57176a0a94bfc6e610ef7b45 (patch)
tree9632917fb8fc895aa554d7b9a4eeeb5f221aa36f /checks.c
parentc231d94e0f620bc25c76415e09f7dea939064bd8 (diff)
downloaddtc-24cb3d0681d9196d57176a0a94bfc6e610ef7b45.zip
dtc-24cb3d0681d9196d57176a0a94bfc6e610ef7b45.tar.gz
dtc-24cb3d0681d9196d57176a0a94bfc6e610ef7b45.tar.bz2
dtc: fix some more -Wshadow warnings
Building on a RHEL6 system produced the following -Wshadow warnings in fstree.c, util.c and checks.c: cc1: warnings being treated as errors checks.c: In function 'parse_checks_option': checks.c:709: error: declaration of 'optarg' shadows a global declaration /usr/include/getopt.h:59: error: shadowed declaration is here make[1]: *** [checks.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: *** Waiting for unfinished jobs.... cc1: warnings being treated as errors fstree.c: In function 'read_fstree': fstree.c:40: error: declaration of 'tmpnam' shadows a global declaration /usr/include/stdio.h:208: error: shadowed declaration is here make[1]: *** [fstree.o] Error 1 cc1: warnings being treated as errors util.c: In function 'xstrdup': util.c:42: error: declaration of 'dup' shadows a global declaration /usr/include/unistd.h:528: error: shadowed declaration is here Fix all of these -Wshadow warnings by using slightly different variable names which won't collide with anything else. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Diffstat (limited to 'checks.c')
-rw-r--r--checks.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/checks.c b/checks.c
index 11a4086..47eda65 100644
--- a/checks.c
+++ b/checks.c
@@ -706,15 +706,15 @@ static void disable_warning_error(struct check *c, bool warn, bool error)
c->error = c->error && !error;
}
-void parse_checks_option(bool warn, bool error, const char *optarg)
+void parse_checks_option(bool warn, bool error, const char *arg)
{
int i;
- const char *name = optarg;
+ const char *name = arg;
bool enable = true;
- if ((strncmp(optarg, "no-", 3) == 0)
- || (strncmp(optarg, "no_", 3) == 0)) {
- name = optarg + 3;
+ if ((strncmp(arg, "no-", 3) == 0)
+ || (strncmp(arg, "no_", 3) == 0)) {
+ name = arg + 3;
enable = false;
}