memset bugs.

Roopesh Majeti roopesh.majeti at gmail.com
Fri Nov 27 06:26:07 UTC 2009


Hi All,
Iam new to this fedora world.. a small question on the below discussion:

It is mentioned that having, zero in the third argument is legitimate use
cases. Can somebody direct me to such a use case, as i feel, giving memset a
zero, is asking it, not to do anything [ might have side effects, not sure
from my end, though ].


Regards
Roopesh M.

On Thu, Nov 26, 2009 at 2:24 PM, Caolán McNamara <caolanm at redhat.com> wrote:

> On Wed, 2009-11-25 at 23:39 -0500, Tom Lane wrote:
> > John Reiser <jreiser at bitwagon.com> writes:
> > > On 11/25/2009 02:03 PM, Dave Jones wrote:
> > >> A zero sized memset is always a bug.
> >
> > > No, memset(,,0) is not always a bug.
> >
> > I think it's reasonably safe to assume that a *literal constant* zero in
> > the third argument is a bug.  Whether the header macros can distinguish
> > that from compile-time-constant expressions is an interesting question,
> > but if they can, +1 for throwing an error.
>
> I logged some time ago a trivial patch of
> https://bugzilla.redhat.com/show_bug.cgi?id=532492 which is apparently
> in rawhide now to generally avoid a warning on memset(foo, 0, 0)
>
> C.
>
> --
> fedora-devel-list mailing list
> fedora-devel-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20091127/3178dfb8/attachment.htm>


More information about the fedora-devel-list mailing list