Conditional compile/assembly is a great means of having several (somewhat) similar products generated from the same source. I guarantees that if you fix a problem it will be fixed globally, one verison will not be forgotten. I am very much a proponent of conditionals in product series code. That much said, it sometimes makes it very difficult to read/follow the flow of a version of program. Is there a means in the Keil tools of creating a "clean source" for a given version i. e. a source with all ifdefs removed and only the lines that will be compiled for this version left?. If not, does anyone know of a program that will do that?.
CodeWright can display & print only the "active" lines of your source; it shows a little '+' sign by the "missing" lines, and you can just click it to expand them, if required. It's brilliant - I use it all the time! I think it is possible to save this pre-processed view, although I haven't pursued it myself. One thing to beware of: With most (all?) compilers, the -Dsymbol command-line option assigns the value 1 if no explicit -Dsymbol=value is given; perversely, CodeWright assigns a default value of 0!