lkml.org 
[lkml]   [2011]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: make checkpatch warn about memset with swapped arguments.
Date
Dave Jones <davej@redhat.com> writes:

> Because the second and third arguments of memset have the same type,
> it turns out to be really easy to mix them up.
>
> This bug comes up time after time, so checkpatch should really
> be checking for it at patch submission time.

Or we just readd an optimized bzero() and recommend people use that
instead of memset for zero? And then there won't be too many users left.

I always felt classic BSD was much more sensible regarding this than
ANSI-C.

It's better to avoid errors in the first place than to check for
them later.

-Andi

--
ak@linux.intel.com -- Speaking for myself only


\
 
 \ /
  Last update: 2011-03-17 23:59    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site