git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* read-cache-v5.c: compiler warnings
@ 2012-08-19 19:13 Ramsay Jones
  2012-08-20  8:29 ` Thomas Gummerer
  0 siblings, 1 reply; 3+ messages in thread
From: Ramsay Jones @ 2012-08-19 19:13 UTC (permalink / raw)
  To: t.gummerer; +Cc: GIT Mailing-list

Hi Thomas,

Just an FYI; two out of the three gcc compilers I use (Linux, cygwin
but not MingW), issue the following warnings:

        CC read-cache-v5.o
    read-cache-v5.c: In function `write_index_v5':
    read-cache-v5.c:1011: warning: 'dir' might be used uninitialized in this function
    read-cache-v5.c:1012: warning: 'search' might be used uninitialized in this function
    read-cache-v5.c:1012: warning: 'found' might be used uninitialized in this function

[commit d2537158 ("Write index-v5", 16-08-2012)]

Normally I would take a look and offer a patch, but I haven't found time
to do so in the last 10 days. So, I'm just giving you a heads up ... ;-P

HTH

ATB,
Ramsay Jones

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: read-cache-v5.c: compiler warnings
  2012-08-19 19:13 read-cache-v5.c: compiler warnings Ramsay Jones
@ 2012-08-20  8:29 ` Thomas Gummerer
  2012-08-21 19:04   ` Ramsay Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gummerer @ 2012-08-20  8:29 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: GIT Mailing-list

On 08/19, Ramsay Jones wrote:
> Hi Thomas,
> 
> Just an FYI; two out of the three gcc compilers I use (Linux, cygwin
> but not MingW), issue the following warnings:
> 
>         CC read-cache-v5.o
>     read-cache-v5.c: In function `write_index_v5':
>     read-cache-v5.c:1011: warning: 'dir' might be used uninitialized in this function
>     read-cache-v5.c:1012: warning: 'search' might be used uninitialized in this function
>     read-cache-v5.c:1012: warning: 'found' might be used uninitialized in this function
> 
> [commit d2537158 ("Write index-v5", 16-08-2012)]
> 
> Normally I would take a look and offer a patch, but I haven't found time
> to do so in the last 10 days. So, I'm just giving you a heads up ... ;-P

Thanks for noticing.  This warnings only seem to be issued by older
versions of gcc, which is probably why two compilers give the warnings
while one doesn't.

The variables can never be uninitialized, because they are guarded by
ifs and older versions don't seem to recognize that.  I'll fix them
in a re-roll though (or a separate patch if that's preferred), just
waiting for some feedback for v4 of my series.

> 
> HTH
> 
> ATB,
> Ramsay Jones
> 

Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: read-cache-v5.c: compiler warnings
  2012-08-20  8:29 ` Thomas Gummerer
@ 2012-08-21 19:04   ` Ramsay Jones
  0 siblings, 0 replies; 3+ messages in thread
From: Ramsay Jones @ 2012-08-21 19:04 UTC (permalink / raw)
  To: Thomas Gummerer; +Cc: GIT Mailing-list

Thomas Gummerer wrote:
> On 08/19, Ramsay Jones wrote:
>> Hi Thomas,
>>
>> Just an FYI; two out of the three gcc compilers I use (Linux, cygwin
>> but not MingW), issue the following warnings:
>>
>>         CC read-cache-v5.o
>>     read-cache-v5.c: In function `write_index_v5':
>>     read-cache-v5.c:1011: warning: 'dir' might be used uninitialized in this function
>>     read-cache-v5.c:1012: warning: 'search' might be used uninitialized in this function
>>     read-cache-v5.c:1012: warning: 'found' might be used uninitialized in this function
>>
>> [commit d2537158 ("Write index-v5", 16-08-2012)]
>>
>> Normally I would take a look and offer a patch, but I haven't found time
>> to do so in the last 10 days. So, I'm just giving you a heads up ... ;-P
> 
> Thanks for noticing.  This warnings only seem to be issued by older
> versions of gcc, which is probably why two compilers give the warnings
> while one doesn't.

You would hope that was true, but I would not bet on it! I've seen these types
of warnings (which rely heavily on analysis performed primarily for optimisation)
come and go several times in gcc.

> The variables can never be uninitialized, because they are guarded by
> ifs and older versions don't seem to recognize that.  I'll fix them
> in a re-roll though (or a separate patch if that's preferred), just
> waiting for some feedback for v4 of my series.

Thanks!

ATB,
Ramsay Jones

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-21 19:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-19 19:13 read-cache-v5.c: compiler warnings Ramsay Jones
2012-08-20  8:29 ` Thomas Gummerer
2012-08-21 19:04   ` Ramsay Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).