On Wed, Nov 10, 2010 at 11:20 AM, Cyril Brulebois <[email protected]> wrote: > Matt Turner <[email protected]> (10/11/2010): >> And good grief. Has anyone kept count of how many various incarnations >> of this patch there have been? >> >> if (p) free(p); >> if (p != NULL) free(p); >> then with { } >> then add p = NULL or p = 0. >> >> Is it possible to write a coccinelle patch to catch all of these cases? > > Sorry, I've just started using coccinelle. I guess I could build a > “definitive” patch with all combinations we could think of and keep > that somewhere so that it can be run from time to time; but AFAICT > people like minimal changes at a time (though I understand that > conceptually we're just getting rid of extra conditionals, no matter > how they're written), that's why I went from trivial changes to > slightly less trivial changes.
Oh, don't apologize. I was merely curious. Maybe someone would already know of a semantic patch that's floated around LKML to do this. For every patch like this I see, I become less and less confident that we've found them all. Matt _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
