Re: [PATCH 0/4] drop some "int x = x" hacks to silence gcc warnings

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

 



On Thu, Mar 21, 2013 at 11:44:02AM -0400, Jeff King wrote:

> >     I am for dropping "= x" and leaving it uninitialized at the
> >     declaration site, or explicitly initializing it to some
> >     reasonable starting value (e.g. NULL if it is a pointer) and
> >     adding a comment to say that the initialization is to squelch
> >     compiler warnings.
> 
> I'd be in favor of that, too. In many cases, I think the fact that gcc
> cannot trace the control flow is a good indication that it is hard for a
> human to trace it, too. And in those cases we would be better off
> restructuring the code slightly to make it more obvious to both types of
> readers.
> 
> Two patches to follow.
> 
>   [5/4]: fast-import: clarify "inline" logic in file_change_m
>   [6/4]: run-command: always set failed_errno in start_command

And here are two more; with these, our code base should be free of "x =
x" initializations (at least according to clang).

  [7/4]: submodule: clarify logic in show_submodule_summary
  [8/4]: match-trees: drop "x = x" initializations

Not pressing, obviously, but since I had just analyzed the code
yesterday, I wanted to do it while they were still fresh in my mind.

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