From: Eric Blake Date: Wed, 7 Aug 2013 22:44:58 +0000 (-0600) Subject: maint: avoid C99 loop declaration X-Git-Tag: CVE-2013-5651~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed7e7c7d1058c64ef15114b691cf80e380596483;p=thirdparty%2Flibvirt.git maint: avoid C99 loop declaration Commit 3d0e3c1 reintroduced a problem previously squelched in commit 7e5aa78. Add a syntax check this time around. util/virutil.c: In function 'virGetGroupList': util/virutil.c:1015: error: 'for' loop initial declaration used outside C99 mode * cfg.mk (sc_prohibit_loop_var_decl): New rule. * src/util/virutil.c (virGetGroupList): Fix offender. Signed-off-by: Eric Blake --- diff --git a/cfg.mk b/cfg.mk index 13de268690..791c393271 100644 --- a/cfg.mk +++ b/cfg.mk @@ -546,15 +546,21 @@ sc_avoid_attribute_unused_in_header: $(_sc_search_regexp) sc_prohibit_int_ijk: - @prohibit='\<(int|unsigned) ([^(]* )*(i|j|k)(\s|,|;)' \ + @prohibit='\<(int|unsigned) ([^(]* )*(i|j|k)(\s|,|;)' \ halt='use size_t, not int/unsigned int for loop vars i, j, k' \ $(_sc_search_regexp) sc_prohibit_loop_iijjkk: - @prohibit='\<(int|unsigned) ([^=]+ )*(ii|jj|kk)(\s|,|;)' \ - halt='use i, j, k for loop iterators, not ii, jj, kk' \ + @prohibit='\<(int|unsigned) ([^=]+ )*(ii|jj|kk)(\s|,|;)' \ + halt='use i, j, k for loop iterators, not ii, jj, kk' \ $(_sc_search_regexp) +# RHEL 5 gcc can't grok "for (int i..." +sc_prohibit_loop_var_decl: + @prohibit='\