On 06/15/2012 02:35 PM, Julia Lawall wrote:
> On Fri, 15 Jun 2012, Sascha Wildner wrote:
>
>> I've tried to locate the patch that led to
>>
>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5cc4a0341a1295ea56b2e62eb70d96d8fdb94ded
>>
>> and similar changes but have so far been unsuccessful.
>>
>> Any pointers?
>
> I think there is not one. If there was one, I would have mentioned it.
> Return is tricky because Coccinelle is oriented towards control-flow
> graphs, and return breaks out of the control-flow graph.
Too bad. I had hoped to retire the unreached_code.pl from the old
Smatch. That detects unreachable code after a break too. I don't use the
current sparse based Smatch but that might still have that.
> The solution is to replace return by something else, and then search for
> anything after that something else.
>
> - return E;
> + RETURN (E);
>
> You could convert the returns back, but it would be easier to just use
> python to print the line numbers where you find a problem and use the
> argument --no-show-diff, so you aren't bothered by the RETURN changes.
bye
michael
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)