[PATCH 5/5] cfg: Disallow usage of 'index' as variable name

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

 



Since we've run afoul of the Xen-devel build for shadowing a global
declaration of 'index', just disallow using index for a variable name

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 cfg.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cfg.mk b/cfg.mk
index 3111a89..9ba2134 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -564,6 +564,11 @@ sc_avoid_attribute_unused_in_header:
 	halt='use ATTRIBUTE_UNUSED in .c rather than .h files'		\
 	  $(_sc_search_regexp)
 
+sc_prohibit_int_index:
+	@prohibit='\<(int|unsigned)\s*\*?index\>(\s|,|;)'	\
+	halt='use different name than 'index' for declaration'	        \
+	  $(_sc_search_regexp)
+
 sc_prohibit_int_ijk:
 	@prohibit='\<(int|unsigned) ([^(=]* )*(i|j|k)\>(\s|,|;)'	\
 	halt='use size_t, not int/unsigned int for loop vars i, j, k'	\
-- 
2.1.0

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