Skip to contentSkip to conversation

clarify misleading warning message

PATCH In review Michele Martone 3 participants 4 messages Sep 25, 2019 – Oct 5, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clarify misleading warning message

One may think that when warning that
"should %s be a metavariable?"
Coccinelle also treats a given symbol %s as a metavariable. Better state explicitly that this is not the case.

---
 parsing_cocci/check_meta.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
parsing_cocci/check_meta.ml +1 -1
index e728d8f5..b857d3f6 100644
@@ -84,7 +84,7 @@ let rec ident context old_metas table minus i =
 	    not err(* warn only once per id *) && not info.Ast0.isSymbolIdent
 	  then
 	    warning
-	      (Printf.sprintf "line %d: should %s be a metavariable?" rl name)
+	      (Printf.sprintf "line %d: should %s be a metavariable? treating it as symbol." rl name)
       | _ -> ())
   | Ast0.MetaId(name,_,seedval,_) ->
       check_table table minus name;
Signature · 6 lines
2.20.1

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
#1 lore raw

parsing_cocci/check_meta.ml let rec ident context old_metas table minus i = · line 87

Quoted 1 line
parsing_cocci/check_meta.ml +1 -0
+	      (Printf.sprintf "line %d: should %s be a metavariable? treating it as symbol." rl name)

How do you think about to use the format string
“line %d: Should %s be a metavariable?\nThis item will be treated as a symbol.”?

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

#2 lore raw
In reply to Michele Martone
Quoted 4 lines · Michele Martone

One may think that when warning that
"should %s be a metavariable?"
Coccinelle also treats a given symbol %s as a metavariable. Better state explicitly that this is not the case.

The change is ok. Please add a Signed-off-by:

thanks,
julia

Quoted 18 lines
---
 parsing_cocci/check_meta.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
parsing_cocci/check_meta.ml +1 -2
index e728d8f5..b857d3f6 100644
@@ -84,7 +84,7 @@ let rec ident context old_metas table minus i =
 	    not err(* warn only once per id *) && not info.Ast0.isSymbolIdent
 	  then
 	    warning
-	      (Printf.sprintf "line %d: should %s be a metavariable?" rl name)
+	      (Printf.sprintf "line %d: should %s be a metavariable? treating it as symbol." rl name)
       | _ -> ())
   | Ast0.MetaId(name,_,seedval,_) ->
       check_table table minus name;
--
Quoted 3 lines

2.20.1

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci