[OPEN-ILS-DEV] Re: PATCH: bzero is deprecated and unnecessary
Mike Rylander
mrylander at gmail.com
Sun Sep 30 20:51:25 EDT 2007
On 9/30/07, Scott McKellar <mck9 at swbell.net> wrote:
>
> --- Mike Rylander <mrylander at gmail.com> wrote:
>
> > The macro, as created, differs from the suggested in that it does not
> > create temp vars for s and n. The compiler was not at all happy
> > about
> > the void casting for some reason, so I just act on the buffer (s)
> > passed.
>
> Sorry, that was my mistake. In my original proposal, temp_s should
> have been declared as char *, not void *. The memset works with a
> void *, but the indexing on the next line doesn't -- you can't
> dereference a void pointer.
>
> I tested the revised version with a little Hello World program.
> With the char * instead of a void * on the temporary, it compiled
> and ran just fine.
>
> That'll teach me not to post untested code. (Well, actually, it
> probably won't.)
>
> It's worth a little extra trouble to make the macro safer.
>
So it is written, so it shall be done (though, after you jogged my
memory, I reailzed could just cast to a char*). Thanks, Scott.
Anything else? Are we ready to let mayhem ensue by committing and
collectively compiling with -DNDEBUG ?
--
Mike Rylander
| VP, Research and Design
| Equinox Software, Inc. / The Evergreen Experts
| phone: 1-877-OPEN-ILS (673-6457)
| email: miker at esilibrary.com
| web: http://www.esilibrary.com
More information about the Open-ils-dev
mailing list