We have a large number of C / C ++ code compiled for several purposes, separated by #ifdefs. One of the goals is very different from the others, and it is often important to know if the code you are editing is compiled for this purpose. Unfortunately, #ifdefs can be very common, so it’s not always obvious which code is compiled for what purpose.
Highlighting Visual Studio #ifdef can be useful for visually identifying code compiled for what purpose, but changing the highlight seems to require changes to the project file.
I'm interested in finding a tool or method that can help codes quickly find out what goals each line of code uses. Even if it requires some kind of manual annotation in the source code, I think it might be useful. In the best case, it is automated, not tied to a specific editor or IDE, and it can be configured to alert in certain conditions (for example, "you modified some code in Target X, be sure to check your code on this platform!").
source
share