logo_kerberos.gif

Difference between revisions of "Talk:Coding style"

From K5Wiki
Jump to: navigation, search
(New page: 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...)
 
(No difference)

Latest revision as of 19:51, 14 April 2008

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)