On Sun, 17 Jun 2018, SF Markus Elfring wrote:
> >> Should anything be found in the following source code variant then?
> >>
> >> int main(void)
> >> {
> >> unsigned int a = 2, b = 4;
> >> unsigned long c = a << 2 << b;
> >> return c;
> >> }
> >
> > No, because there is no empty statement to match the final ;.
>
> Where do you expect that such an empty statement would occur here?
Because your rule contained ...; which is a ... followed by an empty
statement.
> > The ... matches a complete statement (in general, 0 or more complete
> > statements).
> > It doesn't match return c
>
> Is this line also a complete statement?
No. return c is not a complete statement. return c; is, but then there
is nothing to match the ;
>
> I am struggling still with the presented interpretations if the SmPL ellipsis
> should match an expression or/and statements.
If it is in the middle of an expression, it matches a single expression.
If it is elsewhere it matches a sequence of 0 or more statements. It can
also match eg a sequence of 0 or more field declarations in a structure
declaration or 0 or more parameters in a function header.
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci