Re: possible code error at run_command.c

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

 



Erik Faye-Lund schrieb:
> On Mon, Dec 21, 2009 at 9:30 AM, Johannes Sixt <j.sixt@xxxxxxxxxxxxx> wrote:
>> Frank Li schrieb:
>>> Maybe some excute path miss initialized it. Otherwise compiler will
>>> not report warning.
>> LOOK AT THE CODE. There is no such code path.
>>
> 
> That's odd.

Only if Frank did the homework and removed the initialization from

	int failed_errno = failed_errno;

> I agree, there isn't such a code path. But this is the
> first time I've ever seen this MSVC-feature turn up false positives,
> which puzzles me.

This line will trigger the check. It initializes failed_errno with itself,
which is still uninitialized at this time.

Note that we have more definitions of this kind:

$ git grep -E ' ([a-zA-Z_][a-zA-Z_0-9]*) = \1[;,]' *.c
builtin-rev-list.c:             int reaches = reaches, all = all;
match-trees.c:          unsigned mode1 = mode1;
match-trees.c:          unsigned mode2 = mode2;
run-command.c:  int failed_errno = failed_errno;
transport.c:            int cmp = cmp, len;
wt-status.c:    int status = status;

-- Hannes

--
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]