When "v8M Has CMSE Instructions" is set to Yes in the project configuration, the preprocessor constant __ARM_FEATURE_CMSE is set differently when compiling (gcc) and when running code analyzer.
The following code produces value 3 (correct) at the compilation stage but value 1 (incorrect) at the code analysis stage.
ES output when rebuilding the project:
Display All
This makes the code analyser fail when compiling our projects that use this CMSIS header: github.com/ARM-software/CMSIS_…e/Include/core_armv8mml.h
Note that when "v8M Has CMSE Instructions" is set to No, both the stages report value of 1 which makes me believe that the option might be not passed to the code analyzer.
To reproduce: open the attached project, rebuild it.
Embedded Studio version: 6.40
The following code produces value 3 (correct) at the compilation stage but value 1 (incorrect) at the code analysis stage.
ES output when rebuilding the project:
Source Code
- Rebuilding ‘ses_build_time’ from solution ‘ses_build_time’ in configuration ‘Debug’
- 3> Compiling ‘main.c’
- 5> Assembling ‘Cortex_M_Startup.s’
- 6> Assembling ‘SEGGER_THUMB_Startup.s’
- 3> /Users/ti102724/work/ses_build_time/Source/main.c:32:4: warning: CMSE is 3 [-W#warnings]
- 3> #warning CMSE is 3
- 3> ^
- 3> 1 warning generated.
- 3> Analyzing main.c
- 3> 1 warning generated.
- 3> /Users/ti102724/work/ses_build_time/Source/main.c:30:4: warning: CMSE is 1 [clang-diagnostic-#warnings]
- 3> #warning CMSE is 1
- 3> ^
- 7> Linking ses_build_time.elf
- Build complete
Note that when "v8M Has CMSE Instructions" is set to No, both the stages report value of 1 which makes me believe that the option might be not passed to the code analyzer.
To reproduce: open the attached project, rebuild it.
Embedded Studio version: 6.40