Talk:Coding style

From K5Wiki
Revision as of 19:51, 14 April 2008 by KenRaeburn (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

I think the bits about not passing NULL to realloc or free are obsolete. So is allowing K&R style function declarations or definitions in new code instead of using prototype style.

Using calloc or memset with pointer fields isn't so much wrong as incomplete. It's probably reasonable to clobber whatever might have been there before (unless we've got good tools for tracking uninitialized storage, and we think we meant to initialize everything), it just isn't guaranteed to give you null pointers, so if you want pointers initialized to null, you should do that also, explicitly.

--KenRaeburn 19:51, 14 April 2008 (EDT)

Personal tools