Tool/software:
Hi
This may be a stupid question, but.....
i'm using CCS v12.8.1 with TICLANG & sdk8.3 for CC1312
the one project (rfPacketTx_CC1312R1_LAUNCHXL_tirtos7_ticlang) i downloaded from resource compiler has the following
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_ALIGN(rxDataEntryBuffer, 4)
static uint8_t
rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,PAYLOAD_LENGTH,NUM_APPENDED_BYTES)];
#elif defined(__GNUC__)
static uint8_t rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,PAYLOAD_LENGTH,NUM_APPENDED_BYTES)] __attribute__((aligned(4)));
#else
#error This compiler is not supported
#endif //defined(__TI_COMPILER_VERSION__)
As it transpires, it appears that __GNUC__ is defined.
My question is:
"Where is __GNUC__ defined???"
thanks in advance
Hi Moshe,
This is not a stupid question. I agree it can be confusing.
The __TI_COMPILER_VERSION__ corresponds to our old CCS compiled (as used on the CC1310), and here, if you use rfPacketRx, you can see that it is indeed defined:
The __GNUC__ defined corresponds to both our new llvm based ticlang compiler, and gcc, which is why you see it defined in your project.
Regards,
Arthur
Hi Arthur
Yes, i was aware of that part..but....where is the actual #define for __GNUC__ located?
Hi Moshe,
It just seems to be defined in the compiler itself: 2.6.3. Generic Compiler Pre-Defined Macro Symbols — TI Arm Clang Compiler Tools User's Guide
Regards,
Arthur
Hi Arthur
Thanks for that link,,so it explains it "at compile time".
But the puzzling thing is that when working in CCS on the source file, __GNUC__ is recognised as defined which implies that there is a #define somewhere in the project properties or in ccs somewhere.
[EDIT]
i found __GNUC__ in project properties | C/C++ | |Preprocessor Include Paths, Macros etc. | Entries ...then in settings entries i clicked on CCS Built-in Compiler Settings (after having 1st clicked 'show built-in values')....so it would appear that that is the probable location!!!
Puzzle solved?
regards
moshe