clarify misleading warning message
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
@@ -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
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
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@@ -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
Quoted 1 line
The change is ok.
I would find a slightly different message nicer.
https://lore.kernel.org/cocci/[email protected]/
https://systeme.lip6.fr/pipermail/cocci/2019-September/006339.html
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci