Arthur David Olson said:
Back in the 1980s (when this code had its origins), NULL pointers weren't guaranteed to be all zeroes; having a static, otherwise unused structure (which was guaranteed to be initialized correctly) for initialization purposes was cheap portability insurance. (The insurance was taken out consistently, both for uniformity and to avoid problems if a pointer was added to a structure later.) Given updates to the C standard and waning interest in supporting old systems, this insurance may well no longer be needed.
Disagree. The standard still doesn't say that you can memset to 0 to get a NULL pointer. Embedded systems in particular may well have odd setups that mean that a NULL pointer isn't a zero bit pattern (I currently develop on a system where a char is 16 bits and there's something important at address zero). -- Clive D.W. Feather | If you lie to the compiler, Email: clive@davros.org | it will get its revenge. Web: http://www.davros.org | - Henry Spencer Mobile: +44 7973 377646