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

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

 



"Daniel P. Berrange" <berrange@xxxxxxxxxx> 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.

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]