__STATIC_FORCEINLINE error: #77-D: this declaration has no storage class or type specifier

本文解决MDK编译使用CMSIS库时遇到的__STATIC_FORCEINLINE报错问题,建议更新CMSIS版本至5.4,并更新项目中CMSIS库的头文件位置和库位置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

MDK编译使用CMSIS库的项目时,遇到__STATIC_FORCEINLINE报错,如题

可以尝试更新一下你的CMSIS版本,别忘记更新之后将项目里的CMSIS库的头文件位置和库位置更新一下。

其定义位于:cmsis_armcc.h

我的更新到CMSIS-5.4之后可用。该版本中的cmsis_armcc.h头如下所示:

* @file     cmsis_armcc.h
* @brief    CMSIS compiler ARMCC (Arm Compiler 5) header file
* @version  V5.0.4
* @date     10. January 2018

 

../Middlewares/ST/ARM/DSP/Inc/arm_math.h(1132): warning: #47-D: incompatible redefinition of macro "__PKHBT" (declared at line 852 of "../Drivers/CMSIS/Include/cmsis_armcc.h") #define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(1134): warning: #47-D: incompatible redefinition of macro "__PKHTB" (declared at line 855 of "../Drivers/CMSIS/Include/cmsis_armcc.h") #define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(1735): error: #79: expected a type specifier __STATIC_FORCEINLINE int32_t __SMMLA( ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(1735): error: #101: "int32_t" has already been declared in the current scope __STATIC_FORCEINLINE int32_t __SMMLA( ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(1735): error: #141-D: unnamed prototyped parameters not allowed when body is present __STATIC_FORCEINLINE int32_t __SMMLA( ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(1740): error: #20: identifier "sum" is undefined return (sum + (int32_t) (((int64_t) x * y) >> 32)); ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(1740): error: #20: identifier "x" is undefined return (sum + (int32_t) (((int64_t) x * y) >> 32)); ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(1740): error: #20: identifier "y" is undefined return (sum + (int32_t) (((int64_t) x * y) >> 32)); ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(2680): error: #757: function "int32_t" is not a type name int32_t shift, ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(2695): error: #757: function "int32_t" is not a type name int32_t shift, ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(2793): error: #757: function "int32_t" is not a type name int32_t resetStateFlag); ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(2811): error: #757: function "int32_t" is not a type name int32_t resetStateFlag); ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(2830): error: #757: function "int32_t" is not a type name int32_t resetStateFlag); ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(5532): error: #757: function "int32_t" is not a type name int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(5545): error: #757: function "int32_t" is not a type name int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(5558): error: #757: function "int32_t" is not a type name int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(5571): error: #757: function "int32_t" is not a type name int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(5606): error: #757: function "int32_t" is not a type name int32_t * pTapDelay, ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(5642): error: #757: function "int32_t" is not a type name int32_t * pTapDelay, ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(5680): error: #757: function "int32_t" is not a type name int32_t * pTapDelay, ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(5718): error: #757: function "int32_t" is not a type name int32_t * pTapDelay, ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6491): warning: #174-D: expression has no effect int32_t i; /* Index variable */ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6491): error: #65: expected a ";" int32_t i; /* Index variable */ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6495): error: #20: identifier "i" is undefined i = (int32_t) ((x - S->x1) / xSpacing); ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6548): warning: #174-D: expression has no effect int32_t index; /* Index to read nearest output values */ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6548): error: #65: expected a ";" int32_t index; /* Index to read nearest output values */ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6553): error: #20: identifier "index" is undefined index = ((x & (q31_t)0xFFF00000) >> 20); ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6606): warning: #174-D: expression has no effect int32_t index; /* Index to read nearest output values */ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6606): error: #65: expected a ";" int32_t index; /* Index to read nearest output values */ ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6611): error: #20: identifier "index" is undefined index = ((x & (int32_t)0xFFF00000) >> 20); ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6611): error: #31: expression must have integral type index = ((x & (int32_t)0xFFF00000) >> 20); ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6611): error: #18: expected a ")" index = ((x & (int32_t)0xFFF00000) >> 20); ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6911): error: #757: function "int32_t" is not a type name int32_t * circBuffer, ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6912): error: #757: function "int32_t" is not a type name int32_t L, ../Middlewares/ST/ARM/DSP/Inc/arm_math.h(6914): error: #757: function "int32_t" is not a type name int32_t bufferInc, ..\User\modules\master_process.c: 5 warnings, 30 errors
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值