I want to develop a tool that helps in transforming a code like this:
#ifdef MYLIB_ENABLE_DEPRECATED_CODE ... some deprecated code ... #endif into:
#ifdef MYLIB_ENABLE_DEPRECATED_CODE MYLIB_IMPL_DISABLE_DEPRECATED_WARNINGS_PUSH() ... some deprecated code ... MYLIB_IMPL_DISABLE_DEPRECATED_WARNINGS_POP() #endif Basically, I am refactoring code to deprecate parts of it. I wrap the deprecate the code with #ifdef MYLIB_ENABLE_DEPRECATED_CODE and #endif but sometimes forget the custom macros MYLIB_IMPL_DISABLE_DEPRECATED_WARNINGS_PUSH() and MYLIB_IMPL_DISABLE_DEPRECATED_WARNINGS_POP(). I need a way to identify places where those custom macros are missing. Right now, I identify them during build time via CI failures etc, which is painful. How to go about developing such a tool in Clang?