Julia Lawall wrote:
> On Thu, 12 Jan 2012, Robert Gomulka wrote:
>
>> Hi all,
>> I've tried to write rather simple patch for misplaced semicolon. Code
>> sample is as follows:
>> if (condition);
...
> It should work to say:
>
> @@
> expression E;
> statement S;
> @@
>
> if (E)
> - ;
> S
>
> You may though first want to check that the if and the ; are on the same
> line. Sometimes people put an if like this with a semicolon alone and
> nicely indented on the next line, which looks intentional. You can use
That is still questionable code. And most checkers will complain about
that including gcc -Wextra. We had a handful of those in Wine with FIXME
comments and those were replaced with empty blocks, which looks nicer
and silences also the static checkers:
http://source.winehq.org/git/wine.git/commitdiff/309a8c8d48b7daa790253146f24564e65fa6b287
> position variables, eg p[0].line (in python) to find out the line
> number. Note that line is a string rather than an integer.
bye
michael
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)