All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] for loops and variable declarations...
@ 2007-06-05 11:22 Kevin Jackson
  2007-06-05 11:37 ` Pierre Habouzit
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kevin Jackson @ 2007-06-05 11:22 UTC (permalink / raw)
  To: kernel-janitors

Hi all,

I'm just looking at kernel code for basically the first time - so
please be patient :)

I'm seeing this style of code:

uchar a
...
...
...
...
...
...(many lines later...)
for(a=2; a< VALUE; a++)


Why are loop variables declared so far away from where they are used?
Is this advantageous in some way?  It seems that the scope of the
variables is much larger than having them declared just as they are to
be used eg:

for(uchar a=2; a<VALUE; a++)

Sorry if this is a totally stupid question.

Kev
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2007-06-05 13:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-05 11:22 [KJ] for loops and variable declarations Kevin Jackson
2007-06-05 11:37 ` Pierre Habouzit
2007-06-05 11:59 ` John Anthony Kazos Jr.
2007-06-05 12:23 ` Matthew Wilcox
2007-06-05 13:07 ` Robert P. J. Day

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.