Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[external][ARM][CMSIS] prevent compilation error with C++
C++ have different behavior for const qualifier. The const qualifier used on a declaration of a non-local non-volatile non-template(since C++14)non-inline(since C++17) variable that is not declared extern gives it internal linkage. This is different from C where const file scope variables have external linkage. So add __BEGIN_CDECLS/__END_CDECLS to prevent compilation error. Original compilation error as below: arm-m/CMSIS/Include/cmsis_gcc.h:149:31: error: variable '__copy_table_start__' is used but not defined in this translation unit, and cannot be defined in any other translation unit because its type does not have linkage 149 | extern const __copy_table_t __copy_table_start__; | ^ lk/external/arch/arm/arm-m/CMSIS/Include/cmsis_gcc.h:154:40: note: used here 154 | for (__copy_table_t const* pTable = &__copy_table_start__; pTable < &__copy_table_end__; ++pTable) { | ^ lk/external/arch/arm/arm-m/CMSIS/Include/cmsis_gcc.h:150:31: error: variable '__copy_table_end__' is used but not defined in this translation unit, and cannot be defined in any other translation unit because its type does not have linkage 150 | extern const __copy_table_t __copy_table_end__; | ^ lk/external/arch/arm/arm-m/CMSIS/Include/cmsis_gcc.h:154:72: note: used here 154 | for (__copy_table_t const* pTable = &__copy_table_start__; pTable < &__copy_table_end__; ++pTable) { | ^ lk/external/arch/arm/arm-m/CMSIS/Include/cmsis_gcc.h:151:31: error: variable '__zero_table_start__ ' is used but not defined in this translation unit, and cannot be defined in any other translation uni t because its type does not have linkage 151 | exterlinking build-gdmc/gsp/platform/gsp/debugger.mod.on const __zero_table_t __zero_table_start__; | ^ lk/external/arch/arm/arm-m/CMSIS/Include/cmsis_gcc.h:160:40: note: used here 160 | for (__zero_table_t const* pTable = &__zero_table_start__; pTable < &__zero_table_end__; ++pTable) { | ^ lk/external/arch/arm/arm-m/CMSIS/Include/cmsis_gcc.h:151:31: error: variable '__zero_table_start__ ' is used but not defined in this translation unit, and cannot be defined in any other translation uni t because its type does not have linkage 151 | exterlinking build-gdmc/gsp/platform/gsp/debugger.mod.on const __zero_table_t __zero_table_start__; | ^ lk/external/arch/arm/arm-m/CMSIS/Include/cmsis_gcc.h:160:40: note: used here 160 | for (__zero_table_t const* pTable = &__zero_table_start__; pTable < &__zero_table_end__; ++pTable) { | ^ lk/external/arch/arm/arm-m/CMSIS/Include/cmsis_gcc.h:152:31: error: variable '__zero_table_end__' is used but not defined in this translation unit, and cannot be defined in any other translation unit because its type does not have linkage 152 | extern const __zero_table_t __zero_table_end__; | ^ lk/external/arch/arm/arm-m/CMSIS/Include/cmsis_gcc.h:160:72: note: used here 160 | for (__zero_table_t const* pTable = &__zero_table_start__; pTable < &__zero_table_end__; ++pTable) { |
- Loading branch information