This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I have one C header file (used as a debug tool) that must use GCC extension (variadac macro) and I want the header file itself to enable GCC extension (--gcc switch) automatically or throw a #error if the compiler doesn't support --gcc. i.e. if the user choose to include the header file (tool) in their project, the project will be automatically upgraded to support GCC extension or the project will fail to compile.
Is there a neat way to do that in CCS? I couldn't find any pragma related to that in the compiler/assembler manual.
You can't do that. But you can add this to your header file ...
#ifndef __GNUC__
#warn "This file must be built with --gcc"
#endif
The preprocessor symbol __GNUC__ is automatically defined by the compiler when the option --gcc is used.
Hope this helps ...
-George
George Mock said:The preprocessor symbol __GNUC__ is automatically defined by the compiler when the option --gcc is used.
This is not true of all versions of the TI compiler. See this forum thread for more detail in regards to the TI ARM compiler. The situation on other compilers is similar.
Thanks and regards,
-George