I'm trying to make a semantic patch which removes useless casts to
free(). ie, free(void *)tmp) -> free(tmp).

The semantic patch I have now is:

@@
type T;
expression E;
@@
- free ((T *) E);
+ free (E);

which works when T is char, void, or another recognizable C type.

I have some instances of free((GLvoid *) ...) which are not
recognized. I've tried using --all-includes -I ... and including the
file which provides the GLvoid typedef, but without success.

Is there a way to tell Coccinelle that GLvoid is typedef'd to void?

Thanks,
Matt
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to