On Sat, May 14, 2011 at 8:17 PM, Jim Cromie <[email protected]> wrote:
> On Sat, May 14, 2011 at 1:19 AM, Julia Lawall <[email protected]> wrote:
>>> @ for_pc8736x_gpio @
>>> expression CT, DEVNAME;
>>> expression MIN;
>>> dev_t devid;
>>> identfifier major, rc;
>>
>> identifier is spelled wrong.
>>
>> julia
>
> oof.  that might have taken a while to find.
>
> FWIW, testing w following suggests opportunity for better warnings
>
>      1
>      2 @ md @
>      3 expression ct, name;
>      4 expression major, minor;
>      5 //expression MKDEV_expr;
>      6 position pdecl;
>      7 @@
>      8
>      9 {@pdecl
>     10 + dev_t devt = MKDEV(major,minor);
>     11   ...
>     12 - MKDEV(major,minor)
>     13 + devt
>     14   ...
>     15 }
>     16
>     17 @@
>     18 dev_t devt;
>     19 expression ct, name;
>     20 identifier foo;
>     21 idenftifier foob;
>     22 @@
>     23
>     24 - register_chrdev_region(devt, ct, name)
>     25 + register_chrdev_ids(&devt, ct, name)
> chrdev.cocci-expr (END)
>
> grep tokens
> MKDEV || register_chrdev_region
> warning: md: metavariable name not used in the - or context code
> warning: md: metavariable ct not used in the - or context code
> warning: rule starting on line 17: metavariable foo not used in the -
> or context code
> warning: rule starting on line 17: metavariable foob not used in the -
> or context code
>
>
> 1 - foob is declared with an unknown metavariable type (ie fat-fingered)
> not one of the usual ones, nor a type defined in the includes.
>
> 2 - is this warning telling me how to fix problem ?
> is it telling me theres a real problem ?

It is telling that foo and foob do not appear at line 24 which is
minus code.
-- 
Nicolas Palix
http://sardes.inrialpes.fr/~npalix/
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to