Caution for those considering MSC 5.0

Karl Heuer karl at haddock.ISC.COM
Fri Feb 19 05:39:17 AEST 1988


In article <278 at ho7cad.ATT.COM> ekb at ho7cad.ATT.COM (Eric K. Bustad) writes:
>As a matter of style, however, I agree with John that one should explicitly
>initialize any variable if your code makes any use of its initial value.

I sometimes use the opposite approach: if I have an object of static duration
whose initial value is irrelevant, I may emphasize this fact by writing e.g.
"int x = ARB;".  Usually I do this within partially-initialized aggregates:
"static struct foo x = { &y, 4L, '\0', ARB };", which indicates that the
missing member will be filled in by the subsequent code.

(The value of ARB is, of course, truly arbitary; I generally #define it as 0
so that it can be used to initialize either numbers or pointers.)

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list