Recommend C front-end that preserves preprocessor directives

后端 未结 4 855
说谎
说谎 2021-01-14 00:19

I\'d like to start a project that involves transforming C code, but I\'d like to include the preprocessor directives. I don\'t want to reinvent th

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-14 01:00

    Take the GNU gcc compiler, the flags required to pre-process the source is gcc -E mysource.c, see here for further information. As for pretty printing it, there's indent and this explains the usage here, this is a bit old, but nonetheless worthy of mention. There is also cflow that can produce a map of the source.

    Sorry if I misunderstood what you're looking for...

提交回复
热议问题