[Toybox] [PATCH] bzero -> memset - a sufficiently useful compiler will optimize away differences

Rob Landley rob at landley.net
Sat Feb 18 20:46:46 PST 2012


On 02/17/2012 02:43 AM, Nathan McSween wrote:
> # HG changeset patch
> # User Nathan McSween <nwmcsween at gmail.com>
> # Date 1329461552 0
> # Node ID bde1bb9b95cd681859672f1e35f0ac32bdb68478
> # Parent  64fdb6cd587c3041b94ee98e2a0f5668cae2f5a0
> bzero -> memset - a sufficiently useful compiler will optimize away differences

You convinced me in irc, but I patched it myself because:

> -	bzero(gof, sizeof(struct getoptflagstate));
> +	memset(gof, '\0', sizeof(struct getoptflagstate));

I dunno why you're using character constants for 0?  (4 chars in vs 1
char of source code?)

*shrug*  Aesthetic issue...

Thanks,

Rob



More information about the Toybox mailing list