Thread: prepro. clean tool / #id#def mess

  1. #1
    Registered User
    Join Date
    Sep 2005

    prepro. clean tool / #id#def mess


    ---- short-------
    i need to get familliar with the sources of a med. sized
    program but it has many #ifdef's.

    is there a tool or gcc/cpp methode to get only
    the c-code after it has been clean from all the #ifdef blocks ?

    unfortunatly there are a lot of #ifdef , #elif 's
    preporcessor driectives most of them only containing
    a 1-5 lines of code , but they are all nested and it's such
    a mess to read.
    additionally most of them are #ifdefs for diffrent parallel
    computing platforms (MPI,PVM,and OLD stuff) and are absolutelly
    uninteresting for me.

    is there a tool or anyway , to clean see the code for just that one #define
    i use ( in this case #define PARALLEL MPI). like a lightweigt cpp that does not modify
    the #includes but only delete the #if , #else --- #endif blocks i don't use ?

    this would reduce the code to a third at least and make it so much easier to read.


  2. #2
    Join Date
    May 2005
    gcc -E

  3. #3
    Registered User
    Join Date
    Sep 2005
    no , try it, the output is SUPER messy. he proprocs all the #includes and does all the macro stuff
    -> out put huge and unreadable.
    i just want him to delete the unused #ifdef blocks

Popular pages Recent additions subscribe to a feed