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.

Problem with predefined macros

Hi,

I would like to differ in my C files and assembler files if it is compiled as Cortex M3 or Cortex M4 without VFP support or as Cortex M4 with VFP support.

I found in the compiler documentation the list of predefined macros and the define __TI_FPv4SPD16_SUPPORT__ should be what I need.

For Cortex M3/M4 my code is compiled with compiler options:
1. -mv7M3 --code_state=16
or
2. -mv7M4 --code_state=16

For Cortex M4F (with VFP)  my code is compiled with compiler options:
3. -mv7M4 --code_state=16 --float_support=FPv4SPD16

I tested it with:

#if defined(__TI_FPv4SPD16_SUPPORT__) && (__TI_FPv4SPD16_SUPPORT__ == 1)
  #error "true"
#else
  #error "false"
#endif

I would expect that I get "true" only for case 3. but I get it also for case 2.
It seems that __TI_FPv4SPD16_SUPPORT__ is defined when the compiler setting -mv7M4 is set, but that's wrong because there exists also Cortex M4 without VFP.

Any idea what I am mabye doing wrong?
Compiler is TI ARM compiler V5.06.

Thanks,
Til