* [Cocci] [PATCH] clarify misleading warning message
@ 2019-09-25 16:54 Michele Martone
2019-09-26 6:51 ` Markus Elfring
2019-10-04 11:21 ` Julia Lawall
0 siblings, 2 replies; 4+ messages in thread
From: Michele Martone @ 2019-09-25 16:54 UTC (permalink / raw)
To: cocci; +Cc: nicolas.palix
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(-)
diff --git a/parsing_cocci/check_meta.ml b/parsing_cocci/check_meta.ml
index e728d8f5..b857d3f6 100644
--- a/parsing_cocci/check_meta.ml
+++ b/parsing_cocci/check_meta.ml
@@ -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;
--
2.20.1
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Cocci] [PATCH] clarify misleading warning message
2019-09-25 16:54 [Cocci] [PATCH] clarify misleading warning message Michele Martone
@ 2019-09-26 6:51 ` Markus Elfring
2019-10-04 11:21 ` Julia Lawall
1 sibling, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2019-09-26 6:51 UTC (permalink / raw)
To: Michele Martone; +Cc: cocci
> + (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
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Cocci] [PATCH] clarify misleading warning message
2019-09-25 16:54 [Cocci] [PATCH] clarify misleading warning message Michele Martone
2019-09-26 6:51 ` Markus Elfring
@ 2019-10-04 11:21 ` Julia Lawall
2019-10-05 9:34 ` [Cocci] " Markus Elfring
1 sibling, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2019-10-04 11:21 UTC (permalink / raw)
To: Michele Martone; +Cc: nicolas.palix, cocci
On Wed, 25 Sep 2019, Michele Martone wrote:
> 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
> ---
> parsing_cocci/check_meta.ml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/parsing_cocci/check_meta.ml b/parsing_cocci/check_meta.ml
> index e728d8f5..b857d3f6 100644
> --- a/parsing_cocci/check_meta.ml
> +++ b/parsing_cocci/check_meta.ml
> @@ -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;
> --
> 2.20.1
>
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Cocci] clarify misleading warning message
2019-10-04 11:21 ` Julia Lawall
@ 2019-10-05 9:34 ` Markus Elfring
0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2019-10-05 9:34 UTC (permalink / raw)
To: Julia Lawall; +Cc: Nicolas Palix, cocci
> The change is ok.
I would find a slightly different message nicer.
https://lore.kernel.org/cocci/35aa94ff-b101-75b1-9bca-20afef883715@web.de/
https://systeme.lip6.fr/pipermail/cocci/2019-September/006339.html
Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-10-05 9:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 16:54 [Cocci] [PATCH] clarify misleading warning message Michele Martone
2019-09-26 6:51 ` Markus Elfring
2019-10-04 11:21 ` Julia Lawall
2019-10-05 9:34 ` [Cocci] " Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).