Hot!Get a list of macros

Author
suprastar
Starting Member
  • Total Posts : 30
  • Reward points : 0
  • Joined: 2016/03/31 00:19:28
  • Location: 0
  • Status: offline
2017/07/17 01:59:42 (permalink)
0

Get a list of macros

I am working on a project which relies heavily on defines in a config file, and these defines are regularly nested, i.e. the the position if the 6th member is defined by position and size of the fifth member, and so on until member 0.
 
I would like to get a file with all of my macros expanded. I looked on Stack Overflow for gcc options, and -E and/or -dD options were recommended, but I just can't get them to work. -dD does nothing without a file, if I specify a file, I get errors.
 
Is there a way to do it in MPLAB X? I am using xc32 v1.40
#1

3 Replies Related Threads

    jdeguire
    Super Member
    • Total Posts : 346
    • Reward points : 0
    • Joined: 2012/01/13 07:48:44
    • Location: United States
    • Status: offline
    Re: Get a list of macros 2017/07/17 05:56:14 (permalink)
    +1 (1)
    Add a single dash ("-") to the end of your command.
    #2
    suprastar
    Starting Member
    • Total Posts : 30
    • Reward points : 0
    • Joined: 2016/03/31 00:19:28
    • Location: 0
    • Status: offline
    Re: Get a list of macros 2017/07/17 07:53:41 (permalink)
    0
    jdeguire
    Add a single dash ("-") to the end of your command.




    Sorry, I didn't quite understand.
    When I make a file in my PROJECT.X directory, called preproc.txt, and enter the following string in the additional options box:
    -dD -preproc.txt
    I get the following error:
    xc32-gcc.exe: fatal error: cannot specify -o with -c, -S or -E with multiple files
     
    I truly do not understand what you meant. Could you please give me an example of what I should write in the additional options box, and where will the output be?
    #3
    andersm
    Super Member
    • Total Posts : 2180
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: offline
    Re: Get a list of macros 2017/07/26 10:49:37 (permalink)
    +1 (1)
    Open the project properties, go to "XC32 (Global Options)" and turn on the "Don't delete intermediate files" option and rebuild your project. The preprocessed source files are now saved in the project build folder with an *.i extension.
    #4
    Jump to:
    © 2017 APG vNext Commercial Version 4.5