Domanda

I have a large, legacy C code base to look at, and there are lots of #ifdefs and #ifndefs throughout the code, mostly to maintain backwards compatibility with environments and operating systems that now no longer exist.

Is there any preprocessor-like tool that I could run this code through, that would take in all these C (mainly .c and .h, some .cpp etc) code and output set of source files getting rid of those blocks of code that would otherwise never be relevant? That would certainly make browsing the code easier for me, in addition to, perhaps cleaning it up in the in the long run.

È stato utile?

Soluzione

You can use coan for this. Read the "About" page and the man page.

The spin command can output your cleaned up sources under a directory of your choice.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top