aegis said:
Under c90, not c99, where is the behavior
outlined for memset zeroing such an
object of this struct type?
Everything in it is an int, so you're in the clear. It isn't actually
possible AFAIK to prove from C90 that memsetting (to 0) an aggregate
object containing only integral types will give each of them the value
0, but IIRC according to ISO there are *no* implementations where it
doesn't. I'd give references if I had them. Perhaps someone from ISO
can clarify.
I know under c99 you have the possibility
of creating a trap representation or
raising an implementation defined signal
I don't think so, actually - not for 0.
I consider myself a rather conservative C programmer, and I regularly
blast an entire memset's-worth of 0s right through my integer-only
aggregate data structures. Not terribly often, though - and, to be
precise, not all that regularly either. But sometimes, anyway. What
*is* the word? Ah! Fearlessly. I fearlessly use memset to 'zero out'
integer-only aggregate data structures. Despite the fact that I haven't
a clue what platforms my code will be run on.
Of course, if there are pointers or floaty-pointy thingies around,
that's a different matter.