{"thread":{"id":"25957","subject":"[PATCH 14/14] wt-status.c: Initialise variable to suppress msvc warning","startedAt":"2010-12-04T19:12:34Z","lastAt":"2010-12-10T15:43:12Z","messageCount":8,"participants":["Ramsay Jones","Jonathan Nieder","Junio C Hamano","Erik Faye-Lund","Sebastian Schuberth"],"isPatch":true,"patchVersion":1,"patchTotal":14},"messages":[{"id":"157314","messageId":"4CFA92A2.4030801@ramsay1.demon.co.uk","threadId":"25957","inReplyTo":null,"subject":"[PATCH 14/14] wt-status.c: Initialise variable to suppress msvc warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-04T19:12:34Z","receivedAt":"2010-12-04T19:12:34Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nThe msvc compiler thinks that a variable could be used while\nuninitialised and issues the following warning:\n\n    ...\\git\\wt-status.c(152) : warning C4700: uninitialized local \\\n        variable 'status' used\n\nIn order to suppress the warning, we simply initialise the\nvariable to zero.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n wt-status.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex d9f3d9f..9b4b5bf 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -149,7 +149,7 @@ static void wt_status_print_change_data(struct wt_status *s,\n {\n \tstruct wt_status_change_data *d = it->util;\n \tconst char *c = color(change_type, s);\n-\tint status = status;\n+\tint status = 0;\n \tchar *one_name;\n \tchar *two_name;\n \tconst char *one, *two;\n-- \n1.7.3\n"},{"id":"157316","messageId":"20101204205206.GB3170@burratino","threadId":"25957","inReplyTo":"4CFA92A2.4030801@ramsay1.demon.co.uk","subject":"Re: [PATCH 14/14] wt-status.c: Initialise variable to suppress msvc warning","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-12-04T20:52:06Z","receivedAt":"2010-12-04T20:52:06Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ramsay Jones wrote:\n\n> --- a/wt-status.c\n> +++ b/wt-status.c\n> @@ -149,7 +149,7 @@ static void wt_status_print_change_data(struct wt_status *s,\n>  {\n>  \tstruct wt_status_change_data *d = it->util;\n>  \tconst char *c = color(change_type, s);\n> -\tint status = status;\n> +\tint status = 0;\n\nJust for the record (I assume you are already aware of this):\n\n http://thread.gmane.org/gmane.comp.version-control.git/133278/focus=133422\n http://thread.gmane.org/gmane.comp.version-control.git/124676/focus=124803\n\nI personally feel lukewarm about this kind of change.  Is it possible to\nsuppress this warning from msvc?\n"},{"id":"157708","messageId":"4D011D30.4070405@ramsay1.demon.co.uk","threadId":"25957","inReplyTo":"20101204205206.GB3170@burratino","subject":"Re: [PATCH 14/14] wt-status.c: Initialise variable to suppress msvc warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-09T18:17:20Z","receivedAt":"2010-12-09T18:17:20Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Jonathan Nieder wrote:\n> \n> Just for the record (I assume you are already aware of this):\n> \n>  http://thread.gmane.org/gmane.comp.version-control.git/133278/focus=133422\n>  http://thread.gmane.org/gmane.comp.version-control.git/124676/focus=124803\n\nYes\n\n> I personally feel lukewarm about this kind of change.  \n\nOK.\n\nJunio, could you please drop patches 5-14 from the series; the first four patches\nare the important ones and I'd rather they didn't get held up. Thanks!\n\nATB,\nRamsay Jones\n"},{"id":"157710","messageId":"7vmxoeg3wp.fsf@alter.siamese.dyndns.org","threadId":"25957","inReplyTo":"4D011D30.4070405@ramsay1.demon.co.uk","subject":"Re: [PATCH 14/14] wt-status.c: Initialise variable to suppress msvc warning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-12-09T19:08:38Z","receivedAt":"2010-12-09T19:08:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> Junio, could you please drop patches 5-14 from the series; the first four patches\n> are the important ones and I'd rather they didn't get held up. Thanks!\n\nHave these four patches been Acked by interested parties?\n\nI think I saw 1/N and 2/N acked by Erik and 4/N acked by SSchuberth and\nJ6t, but any words on 3/N?\n\nNot that I deeply care nor have environment to test changes to [3/N], but\nI am wondering if these need conditional definition to futureproof (e.g.\nwhat happens when the header you are using the definition _I64_MIN from,\nor some other headers, started defining these constats?).\n"},{"id":"157712","messageId":"AANLkTi=SzDhoQnLeKUvWe7A6r-7MT-DTLuDGLprqid9X@mail.gmail.com","threadId":"25957","inReplyTo":"7vmxoeg3wp.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 14/14] wt-status.c: Initialise variable to suppress msvc warning","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2010-12-09T19:46:02Z","receivedAt":"2010-12-09T19:46:02Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Thu, Dec 9, 2010 at 8:08 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>\n>> Junio, could you please drop patches 5-14 from the series; the first four patches\n>> are the important ones and I'd rather they didn't get held up. Thanks!\n>\n> Have these four patches been Acked by interested parties?\n>\n> I think I saw 1/N and 2/N acked by Erik and 4/N acked by SSchuberth and\n> J6t, but any words on 3/N?\n>\n> Not that I deeply care nor have environment to test changes to [3/N], but\n> I am wondering if these need conditional definition to futureproof (e.g.\n> what happens when the header you are using the definition _I64_MIN from,\n> or some other headers, started defining these constats?).\n\nI'm not sure if I follow this entirely. _I64_MIN is defined by\nlimits.h on Windows, and limits.h has a header-guard (or \"#pragma\nonce\" as Microsoft-code tends to prefer).\n\nOh, right. You mean if someone else starts defining INTMAX_MAX etc? If\nsomeone includes an stdint/inttypes-implementation while including\ngit-compat-util.h, we're going to have a boat-load of similar issues\nanyway. I think guarding them is something that's better left to when\nwe encounter the problem (if ever).\n\nAll in all, patch 1 though 4 looks good to me. And thanks to Ramsay\nfor cleaning up my mess :)\n"},{"id":"157818","messageId":"AANLkTinty08S2vT9ZSVQW03yL5uzrmqW7k_Ozad-q-E2@mail.gmail.com","threadId":"25957","inReplyTo":"AANLkTi=SzDhoQnLeKUvWe7A6r-7MT-DTLuDGLprqid9X@mail.gmail.com","subject":"Re: [PATCH 14/14] wt-status.c: Initialise variable to suppress msvc warning","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2010-12-10T13:35:30Z","receivedAt":"2010-12-10T13:35:30Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Thu, Dec 9, 2010 at 20:46, Erik Faye-Lund <kusmabite@gmail.com> wrote:\n\n> On Thu, Dec 9, 2010 at 8:08 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>>\n>>> Junio, could you please drop patches 5-14 from the series; the first four patches\n>>> are the important ones and I'd rather they didn't get held up. Thanks!\n>>\n>> Have these four patches been Acked by interested parties?\n>>\n>> I think I saw 1/N and 2/N acked by Erik and 4/N acked by SSchuberth and\n>> J6t, but any words on 3/N?\n>>\n>> Not that I deeply care nor have environment to test changes to [3/N], but\n>> I am wondering if these need conditional definition to futureproof (e.g.\n>> what happens when the header you are using the definition _I64_MIN from,\n>> or some other headers, started defining these constats?).\n>\n> I'm not sure if I follow this entirely. _I64_MIN is defined by\n> limits.h on Windows, and limits.h has a header-guard (or \"#pragma\n> once\" as Microsoft-code tends to prefer).\n>\n> Oh, right. You mean if someone else starts defining INTMAX_MAX etc? If\n> someone includes an stdint/inttypes-implementation while including\n> git-compat-util.h, we're going to have a boat-load of similar issues\n> anyway. I think guarding them is something that's better left to when\n> we encounter the problem (if ever).\n\nFYI: In contrast to previous versions, Visual Studio 2010 ships with a\nstdint.h header which defines INTMAX_MAX etc. However, that stdint.h\nis not included by limits.h (in fact, not by *any* other shipping\nheader file, as it seems), so we should not run into any trouble even\nwith VS2010.\n\nSo I agree with Erik about patch 3/N:\n\nAcked-by: Sebastian Schuberth <sschuberth@gmail.com>\n\n-- \nSebastian Schuberth\n"},{"id":"157824","messageId":"AANLkTikE34sk_bsAZSmq-9MaV-RE+GCJgNszm2o2qHGD@mail.gmail.com","threadId":"25957","inReplyTo":"AANLkTinty08S2vT9ZSVQW03yL5uzrmqW7k_Ozad-q-E2@mail.gmail.com","subject":"Re: [PATCH 14/14] wt-status.c: Initialise variable to suppress msvc warning","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2010-12-10T15:05:13Z","receivedAt":"2010-12-10T15:05:13Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Fri, Dec 10, 2010 at 2:35 PM, Sebastian Schuberth\n<sschuberth@gmail.com> wrote:\n> On Thu, Dec 9, 2010 at 20:46, Erik Faye-Lund <kusmabite@gmail.com> wrote:\n>\n>> On Thu, Dec 9, 2010 at 8:08 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>>>\n>>>> Junio, could you please drop patches 5-14 from the series; the first four patches\n>>>> are the important ones and I'd rather they didn't get held up. Thanks!\n>>>\n>>> Have these four patches been Acked by interested parties?\n>>>\n>>> I think I saw 1/N and 2/N acked by Erik and 4/N acked by SSchuberth and\n>>> J6t, but any words on 3/N?\n>>>\n>>> Not that I deeply care nor have environment to test changes to [3/N], but\n>>> I am wondering if these need conditional definition to futureproof (e.g.\n>>> what happens when the header you are using the definition _I64_MIN from,\n>>> or some other headers, started defining these constats?).\n>>\n>> I'm not sure if I follow this entirely. _I64_MIN is defined by\n>> limits.h on Windows, and limits.h has a header-guard (or \"#pragma\n>> once\" as Microsoft-code tends to prefer).\n>>\n>> Oh, right. You mean if someone else starts defining INTMAX_MAX etc? If\n>> someone includes an stdint/inttypes-implementation while including\n>> git-compat-util.h, we're going to have a boat-load of similar issues\n>> anyway. I think guarding them is something that's better left to when\n>> we encounter the problem (if ever).\n>\n> FYI: In contrast to previous versions, Visual Studio 2010 ships with a\n> stdint.h header which defines INTMAX_MAX etc. However, that stdint.h\n> is not included by limits.h (in fact, not by *any* other shipping\n> header file, as it seems), so we should not run into any trouble even\n> with VS2010.\n>\n\nVery interesting, thanks. Did you try to compile Git on VS2010? This\nsounds like a reason for me to install VS2010 on one of my machines...\n:)\n"},{"id":"157825","messageId":"AANLkTimXVXoY3tENBy1EzTF7Hg00WPpww6pCf-hF6aT9@mail.gmail.com","threadId":"25957","inReplyTo":"AANLkTikE34sk_bsAZSmq-9MaV-RE+GCJgNszm2o2qHGD@mail.gmail.com","subject":"Re: [PATCH 14/14] wt-status.c: Initialise variable to suppress msvc warning","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2010-12-10T15:43:12Z","receivedAt":"2010-12-10T15:43:12Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Fri, Dec 10, 2010 at 16:05, Erik Faye-Lund <kusmabite@gmail.com> wrote:\n\n>> FYI: In contrast to previous versions, Visual Studio 2010 ships with a\n>> stdint.h header which defines INTMAX_MAX etc. However, that stdint.h\n>> is not included by limits.h (in fact, not by *any* other shipping\n>> header file, as it seems), so we should not run into any trouble even\n>> with VS2010.\n>>\n>\n> Very interesting, thanks. Did you try to compile Git on VS2010? This\n> sounds like a reason for me to install VS2010 on one of my machines...\n> :)\n\nI just gave it a quick try by just importing the VS2008 solution, and\nthere seem to be some CRT related link problems, but these should be\neasy to resolve. I don't have the time right now to look any further\ninto this, sorry.\n\n-- \nSebastian Schuberth\n"}]}