From: Jens Axboe Date: Thu, 29 Nov 2012 20:33:03 +0000 (+0100) Subject: parse: fix wrong "might be used unitialized" warning on some compilers X-Git-Tag: fio-2.0.12~40 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=bfe1d59237aeb5a9c3540b0beb69c686af41dfa9 parse: fix wrong "might be used unitialized" warning on some compilers GCC 3.4.3 on Solaris, I'm looking at you. Apparently: if (a || b) { if (a) c = foo; else if (b) c = bar; *c = foobar; } is too hard to figure out. Signed-off-by: Jens Axboe --- diff --git a/parse.c b/parse.c index 0bbb0b30..13783fa6 100644 --- a/parse.c +++ b/parse.c @@ -361,7 +361,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, long long ull, *ullp; long ul1, ul2; double uf; - char **cp; + char **cp = NULL; int ret = 0, is_time = 0; const struct value_pair *vp; struct value_pair posval[PARSE_MAX_VP]; @@ -536,8 +536,6 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, cp = td_var(data, o->off1); *cp = strdup(ptr); - } else { - cp = NULL; } if (fn)