On Mon, Mar 13, 2017 at 06:54:17AM +0000, dietmar.schind...@manroland-web.com wrote: > > Von: walter harms > > Gesendet: Samstag, 11. März 2017 11:05 > > > > Am 10.03.2017 19:07, schrieb Maxime Coste: > > > ... > > > +for (int i = 0; i < file_count; ++i) { > > > > IMHO it is better to put 'int i' in the definition section and remove the > > int here. > > It make things harder to read (for me), same for the other locations. > > Better put the definition of a variable near its use than at a place > sometimes far above, requiring to jump or scroll back to see it. And 'for' > loop initial declarations were added to the C standard nearly two decades ago > for a reason.
Either way is fine by me, being a C++ developper I have a bias towards declaring variables as close as possible to their place of use (if it were up to me, I would not declare all local variables on the top of the function block), but I think style consistency is pretty important too. It would be nice if their was a coding standard document somewhere though. I asked on the IRC channel to get guidance, and took a look at existing applets to see the coding style used there, but having some agreed upon standard would simplify the discussion. In any case, I dont mind changing the code one way or the other, whatever fits best with busybox. Cheers, Maxime. _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox