解决warning: #1296-D: extended constant initialiser used告警

博客提到在stm32使用c语言时,图1定义会产生#1296 - D告警,依据arm官网提示,将整形数据改成指针的定义方式可解决该告警问题。

        

                                                    图1

图1定义会产生#1296-D: extended constant initialiser used告警,根据arm官网提示改成一下以下定义可以解决,将整形数据改成指针。如图2所示:

                                                       图2 

*** Using Compiler 'V5.06 update 4 (build 422)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Rebuild target 'Main' compiling cfg_value.c... compiling conn.c... ..\conn.c(20): warning: #177-D: variable "can_box" was declared but never referenced CAN_FIFOMailBox_TypeDef *can_box; ..\conn.c: 1 warning, 0 errors compiling IO.c... compiling stm32f10x_it.c... compiling updata.c... ..\updata.c(78): warning: #177-D: variable "add" was declared but never referenced uint32_t add,file_flag; ..\updata.c(78): warning: #177-D: variable "file_flag" was declared but never referenced uint32_t add,file_flag; ..\updata.c: 2 warnings, 0 errors compiling main.c... ..\main.c(87): warning: #1296-D: extended constant initialiser used {0,(u32)motor_step_cmd_demo}, ..\main.c(88): warning: #1296-D: extended constant initialiser used {0,(u32)cfg_write_buf}, ..\main.c(94): warning: #177-D: variable "status" was declared but never referenced static u8 status=0; ..\main.c: 3 warnings, 0 errors compiling HardWare.c... ..\HardWare.c(162): warning: #188-D: enumerated type mixed with another type GPIO_WriteBit( TEP_CFG2_GPIO, TEP_CFG2_PIN,val&1); ..\HardWare.c(163): warning: #188-D: enumerated type mixed with another type GPIO_WriteBit( TEP_CFG3_GPIO, TEP_CFG3_PIN,(val>>1)&1); ..\HardWare.c(164): warning: #188-D: enumerated type mixed with another type GPIO_WriteBit( TEP_CFG4_GPIO, TEP_CFG4_PIN,(val>>1)&1); ..\HardWare.c(501): warning: #111-D: statement is unreachable if ((CAN1->TSR&CAN_TSR_TME2) != CAN_TSR_TME2) ..\HardWare.c: 4 warnings, 0 errors compiling stm32f10x_crc.c... compiling stm32f10x_flash.c... compiling stm32f10x_rcc.c... compiling stm32f10x_gpio.c... compiling motor.c... ..\motor.c(487): warning: #177-D: variable "i" was declared but never referenced uint32_t i,time_run; ..\motor.c(488): warning: #177-D: variable "ptr16" was declared but never referenced uint16_t *ptr16,ad_val; //最大4096 *10 不会超过16位 ..\motor.c(855): warning: #177-D: variable "i" was declared but never referenced uint32_t i,time_run; ..\motor.c(1493): error: #1182: a declaration cannot have a label long pulses; ..\motor.c(1494): error: #268: declaration may not appear after executable statement in block uint32_t calc_temp ; ..\motor.c(1495): error: #268: declaration may not appear after executable statement in block uint32_t cur_mm10 ; ..\motor.c: 3 warnings, 3 errors compiling stm32f10x_can.c... compiling misc.c... compiling stm32f10x_dma.c... compiling stm32f10x_usart.c... compiling stm32f10x_spi.c... compiling stm32f10x_exti.c... compiling stm32f10x_dbgmcu.c... compiling stm32f10x_adc.c... compiling stm32f10x_tim.c... compiling stm32f10x_iwdg.c... compiling system_stm32f10x.c... assembling startup_stm32f10x_md.s... compiling core_cm3.c... ".\obj\ir_12.axf" - 3 Error(s), 13 Warning(s). Target not created. Build Time Elapsed: 00:00:20 解读一下报错信息
最新发布
09-02
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值