Re: [PATCH 8/4] match-trees: drop "x = x" initializations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 22, 2013 at 02:33:16PM -0700, Junio C Hamano wrote:

> Junio C Hamano <gitster@xxxxxxxxx> writes:
> 
> > These three are all updated by the same tree_entry_extract() call,
> > and whenever we use mode[12] we use path[12], so if it decides path1
> > is used or assigned, it should be able to tell mode1 is, too.
> >
> > Unsatisfactory, it surely is...
> 
> And immediately after I wrote the above, I am greeted by this:
> 
>     gcc (Debian 4.4.5-8) 4.4.5
>     match-trees.c:75: error: 'elem1' may be used uninitialized in this function
>     match-trees.c:77: error: 'path1' may be used uninitialized in this function
> 
> and this crazy one on top squelches it.

Ugh, yeah, I should have tried with more compilers. 4.6 complains, but
4.7 doesn't (although I still find it really weird that 4.7 gets it
_half_ right).

> I'll initialize all of them to nonsense values for now.

I think that's sensible.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]