make preprocessor trace the source of a definition

杀马特。学长 韩版系。学妹 提交于 2019-12-11 06:29:28

问题


In a large and complex pile of source (not invented here, hacked together by Elbonian code-slaves) it can be the case that several bits of code have their own local duplicate of some common header file in their path.

Due to the many layers of build and use of guard macros to prevent re-definition, a value #defined in one place may therefore be remembered by the compiler and used elsewhere despite a more "local" header #defining the same thing.

My question is: Can I get the C preprocessor to spit out the name/path of the file where it originally "found" the definition of something?

来源:https://stackoverflow.com/questions/40652595/make-preprocessor-trace-the-source-of-a-definition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!