This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

conditional compile extraction

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?.

Parents
  • 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!

Reply
  • 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!

Children
No data