{"thread":{"id":"31285","subject":"read-cache-v5.c: compiler warnings","startedAt":"2012-08-19T19:13:48Z","lastAt":"2012-08-21T19:04:41Z","messageCount":3,"participants":["Ramsay Jones","Thomas Gummerer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"197294","messageId":"50313AEC.1060700@ramsay1.demon.co.uk","threadId":"31285","inReplyTo":null,"subject":"read-cache-v5.c: compiler warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-08-19T19:13:48Z","receivedAt":"2012-08-19T19:13:48Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Hi Thomas,\n\nJust an FYI; two out of the three gcc compilers I use (Linux, cygwin\nbut not MingW), issue the following warnings:\n\n        CC read-cache-v5.o\n    read-cache-v5.c: In function `write_index_v5':\n    read-cache-v5.c:1011: warning: 'dir' might be used uninitialized in this function\n    read-cache-v5.c:1012: warning: 'search' might be used uninitialized in this function\n    read-cache-v5.c:1012: warning: 'found' might be used uninitialized in this function\n\n[commit d2537158 (\"Write index-v5\", 16-08-2012)]\n\nNormally I would take a look and offer a patch, but I haven't found time\nto do so in the last 10 days. So, I'm just giving you a heads up ... ;-P\n\nHTH\n\nATB,\nRamsay Jones\n"},{"id":"197330","messageId":"20120820082854.GA10909@tommy-fedora","threadId":"31285","inReplyTo":"50313AEC.1060700@ramsay1.demon.co.uk","subject":"Re: read-cache-v5.c: compiler warnings","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2012-08-20T08:29:34Z","receivedAt":"2012-08-20T08:29:34Z","isPatch":false,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"On 08/19, Ramsay Jones wrote:\n> Hi Thomas,\n> \n> Just an FYI; two out of the three gcc compilers I use (Linux, cygwin\n> but not MingW), issue the following warnings:\n> \n>         CC read-cache-v5.o\n>     read-cache-v5.c: In function `write_index_v5':\n>     read-cache-v5.c:1011: warning: 'dir' might be used uninitialized in this function\n>     read-cache-v5.c:1012: warning: 'search' might be used uninitialized in this function\n>     read-cache-v5.c:1012: warning: 'found' might be used uninitialized in this function\n> \n> [commit d2537158 (\"Write index-v5\", 16-08-2012)]\n> \n> Normally I would take a look and offer a patch, but I haven't found time\n> to do so in the last 10 days. So, I'm just giving you a heads up ... ;-P\n\nThanks for noticing.  This warnings only seem to be issued by older\nversions of gcc, which is probably why two compilers give the warnings\nwhile one doesn't.\n\nThe variables can never be uninitialized, because they are guarded by\nifs and older versions don't seem to recognize that.  I'll fix them\nin a re-roll though (or a separate patch if that's preferred), just\nwaiting for some feedback for v4 of my series.\n\n> \n> HTH\n> \n> ATB,\n> Ramsay Jones\n> \n\nThomas\n"},{"id":"197547","messageId":"5033DBC9.7010707@ramsay1.demon.co.uk","threadId":"31285","inReplyTo":"20120820082854.GA10909@tommy-fedora","subject":"Re: read-cache-v5.c: compiler warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-08-21T19:04:41Z","receivedAt":"2012-08-21T19:04:41Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Thomas Gummerer wrote:\n> On 08/19, Ramsay Jones wrote:\n>> Hi Thomas,\n>>\n>> Just an FYI; two out of the three gcc compilers I use (Linux, cygwin\n>> but not MingW), issue the following warnings:\n>>\n>>         CC read-cache-v5.o\n>>     read-cache-v5.c: In function `write_index_v5':\n>>     read-cache-v5.c:1011: warning: 'dir' might be used uninitialized in this function\n>>     read-cache-v5.c:1012: warning: 'search' might be used uninitialized in this function\n>>     read-cache-v5.c:1012: warning: 'found' might be used uninitialized in this function\n>>\n>> [commit d2537158 (\"Write index-v5\", 16-08-2012)]\n>>\n>> Normally I would take a look and offer a patch, but I haven't found time\n>> to do so in the last 10 days. So, I'm just giving you a heads up ... ;-P\n> \n> Thanks for noticing.  This warnings only seem to be issued by older\n> versions of gcc, which is probably why two compilers give the warnings\n> while one doesn't.\n\nYou would hope that was true, but I would not bet on it! I've seen these types\nof warnings (which rely heavily on analysis performed primarily for optimisation)\ncome and go several times in gcc.\n\n> The variables can never be uninitialized, because they are guarded by\n> ifs and older versions don't seem to recognize that.  I'll fix them\n> in a re-roll though (or a separate patch if that's preferred), just\n> waiting for some feedback for v4 of my series.\n\nThanks!\n\nATB,\nRamsay Jones\n"}]}