I'm not completely sure to understand the example.  Is it correct that the 
modified C code has nothing to do with the semantic patch?  Normally, the 
only formatting problems would be inside metavariables.  For example, you 
remove whatever p matches and then put it back.  In that case, the spaces 
are not part of the binding of p, so it uses some heuristics to figure out 
where to put them.  But that does not appear to be the problem here.

If it is indeed the case that the C code shown is related to what is 
matched by the semantic patch, then you can probably avoid the problem by 
reexpressing it as follows:

t *x =
- (t*)
p;

But it would be better if the original version were to work as well.

julia


On Wed, 7 Jul 2010, Kulikov Vasiliy wrote:

> Hi folks,
> 
> is there a way to suppress code tabs/spaces reformatting by coccinelle?
> 
> E.g. I've got a simple semantic path like
> 
> @@
> void* p;
> type t;
> identifier x;
> @@
> -t *x = (t*)p;
> +t *x = p;
> 
> spatch producess such patches (a part of it):
> -        WRITERAP(lp, LE_CSR0);              /* LANCE Controller Status */
> +        WRITERAP(lp, LE_CSR0);/* LANCE Controller Status */
> 
> I don't need any reformatting, only modifications that I explicitly said to 
> do,
> how can I suppress formatting changes?
> 
> Thanks.
> _______________________________________________
> Cocci mailing list
> [email protected]
> http://lists.diku.dk/mailman/listinfo/cocci
> (Web access from inside DIKUs LAN only)
> 
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to