[master] 35b51e28c cocci: Avoid name collisions in check_obj.cocci

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Jul 13 09:50:11 UTC 2023


commit 35b51e28c0066d2dbeea59977a1709e0e7cfc961
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu Jul 13 11:41:13 2023 +0200

    cocci: Avoid name collisions in check_obj.cocci
    
    I get a new warning with Coccinelle XXX:
    
    > magic, previously declared as a metavariable, is used as an identifier
    
    I don't remember seeing this warning before, but it looks like @@ blocks
    may not behave as I thought. I didn't review the other semantic patches.

diff --git a/tools/coccinelle/check_obj.cocci b/tools/coccinelle/check_obj.cocci
index d82510210..2d121a5ab 100644
--- a/tools/coccinelle/check_obj.cocci
+++ b/tools/coccinelle/check_obj.cocci
@@ -4,12 +4,12 @@
  */
 
 @@
-expression obj, magic;
+expression obj, magicval;
 @@
 
 if (obj != NULL) {
-- CHECK_OBJ_NOTNULL(obj, magic);
-+ CHECK_OBJ(obj, magic);
+- CHECK_OBJ_NOTNULL(obj, magicval);
++ CHECK_OBJ(obj, magicval);
 ...
 }
 


More information about the varnish-commit mailing list