> +/* Fill an lvalue with zero bits. */ > +#define CLEAR_VAR(S) \ > + do { memset (&(S), 0, sizeof (S)); } while (0)
Hmmm... I don't see the point in this. The macro is almost as long as a bare memset() would be, and replaces a well-known function with something unknown outside this project. It neither hides a bug in an OS nor provides a common way to handle a difficult task across platforms. You also do NOT want to use memset to zero out a C++ structure that contains more than just "plain old data" - you could easily corrupt the structure's hidden data. Also, pedantically speaking, "all bits zero" is not guaranteed to be the same as float 0.0, double 0.0, or pointer (void *)0.