On Thu, 20 Nov 2014, Mitchell Cuddie wrote:

> I am working on a patch that manipulates null pointer usage. However the
> second rule matches code inside macros which causes issues. Is there a
> way to have rule 2 skip macros or rule 1 match against them and thereby
> deactivate rule 2?

Could you send an example of a macro where you don't want a match?

thanks,
julia

> 
> Cheers
> 
> Mitchell
> 
> @p_null disable is_null, isnt_null1, is_zero, isnt_zero@
> expression *E;
> type T;
> position p;
> T *f;
> @@
> (
>     \(E\|f(...)\) == @p NULL
> |
>     \(E\|f(...)\) != @p NULL
> |
>     E =@p NULL
> )
> 
> @np_null depends on !p_null && !ptr_zero disable is_null, isnt_null1,
> is_zero, isnt_zero@
> position p;
> T g;
> expression F;
> @@
> (
>     \(F\|g(...)\)  == @p
> -   NULL
> +   0   
> |
>     \(F\|g(...)\)  != @p
> -   NULL
> +   0
> |
>     F  = @p
> -   NULL
> +   0
> )
> 
> _______________________________________________
> Cocci mailing list
> [email protected]
> https://systeme.lip6.fr/mailman/listinfo/cocci
> 
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to