[libvirt] [PATCH v3 03/35] cfg.mk: correct spacing between type and asterisk in VIR_AUTOFREE

Sukrit Bhatnagar posted 35 patches 6 years, 10 months ago
There is a newer version of this series
[libvirt] [PATCH v3 03/35] cfg.mk: correct spacing between type and asterisk in VIR_AUTOFREE
Posted by Sukrit Bhatnagar 6 years, 10 months ago
Add rule to ensure that there is exactly one blank space between
the type name and the asterisk when passed as the argument to the
VIR_AUTOFREE macro.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
---
 cfg.mk | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/cfg.mk b/cfg.mk
index 196d1b2..d9e90d5 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1068,6 +1068,15 @@ sc_require_attribute_cleanup_initialization:
 	halt='variable declared with a cleanup macro must be initialized' \
 	  $(_sc_search_regexp)
 
+# Rule to ensure that there is exactly one blank space between the
+# type name and the asterisk charcater when passed as the argument
+# to VIR_AUTOFREE.
+sc_require_attribute_cleanup_scalar_type_space:
+	@prohibit='VIR_AUTOFREE\([^ ]+(| {2,})\*\) .*;' \
+    in_vc_files='\.[chx]$$' \
+    halt='there must be exactly one space between the type and asterisk inside VIR_AUTOFREE' \
+      $(_sc_search_regexp)
+
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null
 
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v3 03/35] cfg.mk: correct spacing between type and asterisk in VIR_AUTOFREE
Posted by Erik Skultety 6 years, 10 months ago
On Sat, Jun 30, 2018 at 02:30:07PM +0530, Sukrit Bhatnagar wrote:
> Add rule to ensure that there is exactly one blank space between
> the type name and the asterisk when passed as the argument to the
> VIR_AUTOFREE macro.
>
> Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
> ---

We would have to enforce this everywhere and I don't really see a point in this
kind of check, so NACK to this.

Erik

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