[syslinux] [PATCH 06/23] com32/chain: partiter - simplifications and updates

Michal Soltys soltys at ziu.info
Thu Nov 8 12:35:45 PST 2012


On 2012-11-08 03:26, Shao Miller wrote:
>
> As a matter of fact, it wouldn't conform to Standard C, if it wasn't.
> 'free' must accept null pointers.  A little trivia: Interestingly,
> Standard C states that after doing so, the pointer value becomes
> indeterminate; could be a trap representation, so it is not safe to
> evaluate afterwards.  free(ptr); printf("Freed: %p\n", ptr); /* Bad */

Yea, that comment is a bit weird. Guess some very old habits of mine 
tend to die hard (but at least I didn't stuff if() there ;)

>
> Same with 'memset(obj_ptr, 0, sizeof *obj_ptr)'
>

Any particular preferences ? the non-type version is (usually) shorter, 
though the code mixes both.

>
> Another opportunity for an 'enum' for these status values, perhaps?
> These look to be mutually exclusive.  I'm mentioning it just because the
> code being changed here, anyway.
>

Noted, will switch this (and other mentioned) to enums.




More information about the Syslinux mailing list