I think you need to implement it as a flag (in the clang front end) and pass it to the clang analyzer. scan-build is just a wrapper so you have to implement another flag for this and invoke the analyzer with --fix flag. Let me know if you need any more help on this. -Aditya