Re: [PATCH] Consistent style for usage of sizeof operator

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

 



On 03/29/2012 09:51 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> The code is splattered with a mix of
> 
>   sizeof foo
>   sizeof (foo)
>   sizeof(foo)
> 
> Standardize on sizeof(foo) and add a syntax check rule to
> enforce it

We might also want to document our policy on 'return 0' and 'sizeof(v)'
in HACKING.

> ---
>  cfg.mk                                       |    4 +

> +++ b/cfg.mk
> @@ -813,3 +813,7 @@ exclude_file_name_regexp--sc_trailing_blank = \.(fig|gif|ico|png)$$
>  
>  exclude_file_name_regexp--sc_unmarked_diagnostics = \
>    ^(docs/apibuild.py|tests/virt-aa-helper-test)$$
> +
> +exclude_file_name_regexp--sc_size_of_brackets = cfg.mk
> +
> +exclude_file_name_regexp--sc_const_long_option = tools/virt-host-validate.c
> diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c

Where's the new rule that actually adds the syntax check?

The rest of the patch looks mechanical, but we have to get the cfg.mk
part right.  I'm also still looking into the report of why cfg.mk
doesn't seem to be working in relation to the latest per-line exceptions
added to gnulib's syntax-check framework.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]