On Mon, 13 Jul 2015, SF Markus Elfring wrote:

> >> 1. Do I need to specify a SmPL constraint like "non-void"
> >>    for such a script?
> >
> > It seems pointless.  If the code is returning something and the return
> > type is void, then the problem is elsewhere.
>
> A C compiler will usually will react with an error display
> for this special case.
> How should a static source code analysis tool deal with it?

Ignore it.  Unless your goal is to check for this specific error.

> Does the metavariable type "expression" match also to the empty string?

No.

>
> >> 2. The expression which is used for a specific return statement
> >>    can be assigned to a SmPL metavariable in an other script variant.
> >>    I would appreciate if I could process the extracted data
> >>    in a more structured way somehow.
> >
> > I have no idea what you want to do.  You can get the AST if you write
> > a script using OCaml:
> >
> > (stringrep,astrep) << r.express;
>
> I guess that I am going to store elements into another SQL database.
>
> How are the chances that more documentation will become available
> for safe processing of corresponding abstract syntax graph instances?

About the same as the chance that a user who wants the documentation will
write it.  I have no plans to do so.  In general, if you know enough OCaml
to use the abstract syntax tree, you also know enough OCaml to figure out
what it is from the source code.  Everything is defined in
parsing_c/ast_c.ml.

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

Reply via email to