Hi,
Does anyone know where to find a list of all the macros predefined by the XCC compiler?
Right now I am looking for one to distinguish the XCC compiler from other compilers.
Thanks
Predefined compiler macros
-
- New User
- Posts: 2
- Joined: Thu Nov 12, 2015 11:40 am
-
- Respected Member
- Posts: 275
- Joined: Fri Mar 12, 2010 6:03 pm
You can dump predefined macros by doing preprocess-only on an empty file with -dM, e.g. xcc -dM -E empty.xc. Normally, you can specify a null file, such as:
gcc -dM -E - </dev/null
but XCC doesn't support that.
gcc -dM -E - </dev/null
but XCC doesn't support that.
-
- New User
- Posts: 2
- Joined: Thu Nov 12, 2015 11:40 am
Here is the best solution I've found so far:
In xTIMEcomposer, go to the project settings, C/C++ General > Paths and Symbols > tab: Symbols
From there you will get a list of all preprocessor macros which are currently defined for C, C++ and XC.
Now the question for the XMOS dev team is: where does this list come from? Most likely it is from xcc, so it would be great to know the command line arguments to get this list directly from xcc.
In xTIMEcomposer, go to the project settings, C/C++ General > Paths and Symbols > tab: Symbols
From there you will get a list of all preprocessor macros which are currently defined for C, C++ and XC.
Now the question for the XMOS dev team is: where does this list come from? Most likely it is from xcc, so it would be great to know the command line arguments to get this list directly from xcc.