Uninitialized static int counters?
Michael ODonnell
michael.odonnell at comcast.net
Sat Feb 7 10:55:11 EST 2009
> The bottom line is that in the section of code you presented,
> what was important was to establish a block so a variable could
> be defined. Adding the do <statement> while(0) is just adding
> some extraneous code that would be most probably optimized out,
> but even if it is not, it is in an error condition.
I suspect that whoever added that code to the kernel cribbed it
from elsewhere without understanding (or maybe not caring whether
they understood) it. At any rate, I wasn't concerned about that
do-while(0) construct so much as the apparent randomness of allowing
the past behavior of other processes to determine whether the kernel
will utter a complaint about the current process's behavior. That,
BTW, is what was in my head when I used the term "Uninitialized"
in my Subject: line, arguably a poor choice of words.
More information about the gnhlug-discuss
mailing list