35
36
37
38
39
40
41
42
43
44
|
35
36
37
38
39
40
41
42
43
44
45
46
|
+
+
|
That ensures (insures?) that all struct members get set to known default values (which need not be NULL/0), and helps harden the code against uninitialized memory access (since all members get initialized to whatever the struct developer deemed sensible, and NULL is generally the sensible default for pointer members).
<h2>When updating structs...</h2>
When changing the members of structs, it is <em>critical</em> that the accompanying "empty_m" macro (described above) also be updated. Failing to do so can lead to undefined results (best case is a compilation failure when the shared struct "empty" instance is initialized from the "empty_m" macro).
After changing a struct, make sure to do a full/clean rebuild or you might see <em>really</em> weird results in code compiled against older struct.
<nowiki><pre>
</pre></nowiki>
|