[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libvir] begin conversion to safer use of sizeof: exposes a harmless bug



"Daniel P. Berrange" <berrange redhat com> wrote:
> On Tue, Dec 11, 2007 at 07:57:51PM +0100, Jim Meyering wrote:
>> Subject: [PATCH] Use a variable name as sizeof argument, not a type name.
>>
>> Given code like: T *var = calloc (n, sizeof (T));
>> Convert to this: T *var = calloc (n, sizeof (*var));
>> This first-cut change adjusts all malloc, calloc, and
>> realloc statements.
...
> ACK.

Thanks.
Committed.

> Should we add a 'HACKING' file which mentions this coding standard and any of
> the others we generally have for the benefit of anyone submitting patches
> in the future

Yes.  I'll propose one along with a separate Makefile rule
to check for this sort of policy.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]