Re: [PATCH v2 2/8] env--helper: new undocumented builtin wrapping git_env_*()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 20, 2019, 22:21 UTC
- Message-ID
- <xmqqlfxvlwyg.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <xmqqpnn7lxet.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 9 quoted lines
> ... > as I am getting > > error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > from here. > > Giving an otherwise useless initial value to ret would be a > workaround.
I've added this on top of the topic before merging to keep the integration going at least for now.
commit 8f86948797a1152594a8dee50d0878604fec3e80 Author: Junio C Hamano <gitster@pobox.com> Date: Thu Jun 20 15:13:14 2019 -0700
SQUASH??? avoid maybe-uninitialized
diff --git a/builtin/env--helper.c b/builtin/env--helper.c index 2bb65ecf3f..29df0567fb 100644 --- a/builtin/env--helper.c +++ b/builtin/env--helper.c @@ -43,6 +43,9 @@ int cmd_env__helper(int argc, const char **argv, const char *prefix) usage_with_options(env__helper_usage, opts); switch (cmdmode) { + default: + BUG("wrong cmdmode"); + break; case ENV_HELPER_BOOL: tmp_int = strtol(env_default, (char **)&env_default, 10); if (*env_default) {