On Thu, Sep 10, 2015 at 8:45 PM, Loganaden Velvindron <logana...@gmail.com> wrote: > On Thu, Sep 10, 2015 at 6:36 PM, Michael McConville < > mmcco...@sccs.swarthmore.edu> wrote: > >> These seem like they were definitely meant to be explicit zeroings. >> >> Hi, > > I'm not entirely sure about this. Since the variable (data) is used before > return, it would not be optimized away by the compiler. > > A case where optimization would happen would be: > > bzero(data,len); > return (-1); > > > Or maybe I'm wrong here ?
It might not be necessary from the optimization danger *right now*, but it may in the future, and serves as documentation of why you bothered to memset it (as opposed to doing so for some other reason, like so it can be reused, or to avoid double free of a pointer in it, etc). Philip Guenther