X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fopt%2Fopt.c;h=bae3c665c93e7594bb4c5e7e32880f5e73b13952;hp=841e9b4eb2d4021c6b97432e2c65edb8e8754d90;hb=d6daa78732b7f67a30283d9cad7c98cbcbdb7414;hpb=be6a5cdadeef4995cc935f2d2443f45f542ed125 diff --git a/ccan/opt/opt.c b/ccan/opt/opt.c index 841e9b4e..bae3c665 100644 --- a/ccan/opt/opt.c +++ b/ccan/opt/opt.c @@ -83,7 +83,7 @@ static const char *next_lopt(const char *p, unsigned *i, unsigned *len) const char *first_sopt(unsigned *i) { const char *p; - unsigned int len; + unsigned int len = 0 /* GCC bogus warning */; for (p = first_opt(i, &len); p; p = next_opt(p, i, &len)) { if (p[0] != '-') @@ -215,7 +215,7 @@ static char *make_optstring(void) static struct option *make_options(void) { struct option *options = malloc(sizeof(*options) * (opt_num_long + 1)); - unsigned int i, num = 0, len; + unsigned int i, num = 0, len = 0 /* GCC bogus warning */; const char *p; for (p = first_lopt(&i, &len); p; p = next_lopt(p, &i, &len)) { @@ -296,7 +296,7 @@ bool opt_parse(int *argc, char *argv[], void (*errlog)(const char *fmt, ...)) while ((ret = getopt_long(*argc, argv, optstring, options, &longidx)) != -1) { char *problem; - const char *name; + const char *name = NULL; /* GCC bogus warning */ /* optopt is 0 if it's an unknown long option, *or* if * -? is a valid short option. */