{"thread":{"id":"30373","subject":"[PATCH] checkout: squelch \"'mode' may be used uninitialized in this function\" warning","startedAt":"2012-04-30T22:39:27Z","lastAt":"2012-05-08T20:26:49Z","messageCount":3,"participants":["dsp@php.net","David Soria Parra","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"190360","messageId":"1335825567-7831-1-git-send-email-dsp@php.net","threadId":"30373","inReplyTo":null,"subject":"[PATCH] checkout: squelch \"'mode' may be used uninitialized in this function\" warning","fromName":"","fromEmail":"dsp@php.net","sentAt":"2012-04-30T22:39:27Z","receivedAt":"2012-04-30T22:39:27Z","isPatch":true,"sender":{"key":"dsp@php.net","avatar":"https://avatars.githubusercontent.com/u/14013?v=4"},"body":"From: David Soria Parra <dsp@php.net>\n\nUse a 'fake' initialization for the 'mode' variable to work around a\nGCC warning as in 5a7a367. The necessary condition to initialize 'mode'\nwill always be true but cannot be checked by the compiler.\n\nSigned-off-by: David Soria Parra <dsp@php.net>\n---\n builtin/checkout.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 84d3eb3..6b8bf31 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -157,7 +157,7 @@ static int checkout_merged(int pos, struct checkout *state)\n \tunsigned char sha1[20];\n \tmmbuffer_t result_buf;\n \tunsigned char threeway[3][20];\n-\tunsigned mode;\n+\tunsigned mode = mode;\n \n \tmemset(threeway, 0, sizeof(threeway));\n \twhile (pos < active_nr) {\n-- \n1.7.8.GIT\n"},{"id":"190630","messageId":"slrnjq4p8c.i00.dsp@experimentalworks.net","threadId":"30373","inReplyTo":"1335825567-7831-1-git-send-email-dsp@php.net","subject":"Re: [PATCH] checkout: squelch \"'mode' may be used uninitialized in this function\" warning","fromName":"David Soria Parra","fromEmail":"dsp@php.net","sentAt":"2012-05-03T10:59:24Z","receivedAt":"2012-05-03T10:59:24Z","isPatch":true,"sender":{"key":"dsp@php.net","avatar":"https://avatars.githubusercontent.com/u/14013?v=4"},"body":"Any update on this patch? Is it going to maint?\n\nOn 2012-04-30, dsp@php.net <dsp@php.net> wrote:\n> From: David Soria Parra <dsp@php.net>\n>\n> Use a 'fake' initialization for the 'mode' variable to work around a\n> GCC warning as in 5a7a367. The necessary condition to initialize 'mode'\n> will always be true but cannot be checked by the compiler.\n>\n> Signed-off-by: David Soria Parra <dsp@php.net>\n> ---\n>  builtin/checkout.c |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/builtin/checkout.c b/builtin/checkout.c\n> index 84d3eb3..6b8bf31 100644\n> --- a/builtin/checkout.c\n> +++ b/builtin/checkout.c\n> @@ -157,7 +157,7 @@ static int checkout_merged(int pos, struct checkout *state)\n>  \tunsigned char sha1[20];\n>  \tmmbuffer_t result_buf;\n>  \tunsigned char threeway[3][20];\n> -\tunsigned mode;\n> +\tunsigned mode = mode;\n>  \n>  \tmemset(threeway, 0, sizeof(threeway));\n>  \twhile (pos < active_nr) {\n"},{"id":"191148","messageId":"20120508202649.GA15502@sigill.intra.peff.net","threadId":"30373","inReplyTo":"slrnjq4p8c.i00.dsp@experimentalworks.net","subject":"Re: [PATCH] checkout: squelch \"'mode' may be used uninitialized in this function\" warning","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-05-08T20:26:49Z","receivedAt":"2012-05-08T20:26:49Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 03, 2012 at 10:59:24AM +0000, David Soria Parra wrote:\n\n> Any update on this patch? Is it going to maint?\n\nI doubt it:\n\n> > diff --git a/builtin/checkout.c b/builtin/checkout.c\n> > index 84d3eb3..6b8bf31 100644\n> > --- a/builtin/checkout.c\n> > +++ b/builtin/checkout.c\n> > @@ -157,7 +157,7 @@ static int checkout_merged(int pos, struct checkout *state)\n> >  \tunsigned char sha1[20];\n> >  \tmmbuffer_t result_buf;\n> >  \tunsigned char threeway[3][20];\n> > -\tunsigned mode;\n> > +\tunsigned mode = mode;\n\nWhat is this based on? This has been fixed since 335c6e4\n(checkout_merged(): squelch false warning from some gcc, 2011-12-15),\nwhich was in v1.7.8.2.\n\n-Peff\n"}]}