#1295-D: Deprecated declaration I2C_Start - give arg types

本文介绍KEIL5编译器中遇到的#1295-D警告,详细解释了无参数函数声明未标明参数类型的问题,并提供了解决方案,即在函数声明中明确指定void参数。

KEIL5编译器报警告,警告内容如下:
#1295-D: Deprecated declaration I2C_Start - give arg types
警告原因无参数函数的函数声明没有标明参数为void型。
在函数声明中加入void即可。

//警告代码
void I2C_Start();
//修改后代码
void I2C_Start(void);
*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'E:\install\Keil_v5\ARM\ARMCC\Bin' Build target 'Target 1' assembling startup_stm32f10x_md.s... compiling core_cm3.c... compiling system_stm32f10x.c... compiling stm32f10x_it.c... compiling main.c... USER\scheduler.h(21): warning: #1295-D: Deprecated declaration Duty_2ms - give arg types void Duty_2ms(); USER\scheduler.h(22): warning: #1295-D: Deprecated declaration Duty_4ms - give arg types void Duty_4ms(); USER\scheduler.h(23): warning: #1295-D: Deprecated declaration Duty_6ms - give arg types void Duty_6ms(); USER\scheduler.h(24): warning: #1295-D: Deprecated declaration Duty_10ms - give arg types void Duty_10ms(); USER\scheduler.h(25): warning: #1295-D: Deprecated declaration Duty_20ms - give arg types void Duty_20ms(); USER\scheduler.h(26): warning: #1295-D: Deprecated declaration Duty_50ms - give arg types void Duty_50ms(); USER\scheduler.h(27): warning: #1295-D: Deprecated declaration Duty_1000ms - give arg types void Duty_1000ms(); USER\scheduler.h(28): warning: #1-D: last line of file ends without a newline #endif USER\main.c: 8 warnings, 0 errors compiling misc.c... compiling delay.c... USER\scheduler.h(21): warning: #1295-D: Deprecated declaration Duty_2ms - give arg types void Duty_2ms(); USER\scheduler.h(22): warning: #1295-D: Deprecated declaration Duty_4ms - give arg types void Duty_4ms(); USER\scheduler.h(23): warning: #1295-D: Deprecated declaration Duty_6ms - give arg types void Duty_6ms(); USER\scheduler.h(24): warning: #1295-D: Deprecated declaration Duty_10ms - give arg types void Duty_10ms(); USER\scheduler.h(25): warning: #1295-D: Deprecated declaration Duty_20ms - give arg types void Duty_20ms(); USER\scheduler.h(26): warning: #1295-D: Deprecated declaration Duty_50ms - give arg types void Duty_50ms(); USER\scheduler.h(27): warning: #1295-D: Deprecated declaration Duty_1000ms - give arg types void Duty_1000ms(); USER\scheduler.h(28): warning: #1-D: last line of file ends without a newline #endif USER\delay.c: 8 warnings, 0 errors compiling stm32f10x_bkp.c... compiling stm32f10x_adc.c... compiling sys.c... compiling INIT.c... compiling stm32f10x_can.c... compiling scheduler.c... USER\scheduler.h(21): warning: #1295-D: Deprecated declaration Duty_2ms - give arg types void Duty_2ms(); USER\scheduler.h(22): warning: #1295-D: Deprecated declaration Duty_4ms - give arg types void Duty_4ms(); USER\scheduler.h(23): warning: #1295-D: Deprecated declaration Duty_6ms - give arg types void Duty_6ms(); USER\scheduler.h(24): warning: #1295-D: Deprecated declaration Duty_10ms - give arg types void Duty_10ms(); USER\scheduler.h(25): warning: #1295-D: Deprecated declaration Duty_20ms - give arg types void Duty_20ms(); USER\scheduler.h(26): warning: #1295-D: Deprecated declaration Duty_50ms - give arg types void Duty_50ms(); USER\scheduler.h(27): warning: #1295-D: Deprecated declaration Duty_1000ms - give arg types void Duty_1000ms(); USER\scheduler.h(28): warning: #1-D: last line of file ends without a newline #endif USER\scheduler.c(176): warning: #1-D: last line of file ends without a newline //////////////////////////end/////////////////////////////////////////// USER\scheduler.c: 9 warnings, 0 errors compiling stm32f10x_cec.c... compiling stm32f10x_dac.c... compiling stm32f10x_crc.c... compiling stm32f10x_dbgmcu.c... compiling stm32f10x_dma.c... compiling stm32f10x_exti.c... compiling stm32f10x_fsmc.c... compiling stm32f10x_flash.c... compiling stm32f10x_iwdg.c... compiling stm32f10x_gpio.c... compiling stm32f10x_i2c.c... compiling stm32f10x_pwr.c... compiling stm32f10x_rcc.c... compiling stm32f10x_rtc.c... compiling stm32f10x_spi.c... compiling stm32f10x_sdio.c... compiling stm32f10x_wwdg.c... compiling stm32f10x_usart.c... compiling stm32f10x_tim.c... compiling IIC_SOFTWARE.c... compiling GPIO.c... compiling ADC.c... CONFIG\ADC.c(172): warning: #1-D: last line of file ends without a newline } CONFIG\ADC.c: 1 warning, 0 errors compiling TIM.c... compiling Spi.c... compiling USART3.c... compiling Uart1.c... CONFIG\Uart1.c(130): warning: #1-D: last line of file ends without a newline } CONFIG\Uart1.c: 1 warning, 0 errors compiling USART2.c... compiling LED.c... compiling mpu6050.c... compiling nrf24l01.c... compiling flow.c... compiling spl06.c... HARDWARE\spl06.c(91): warning: #167-D: argument of type "unsigned char *" is incompatible with parameter of type "int8_t *" IIC_Read_1Byte(hwadr,regadr,&reg_data); HARDWARE\spl06.c(118): warning: #68-D: integer conversion resulted in a change of sign IIC_Read_1Byte( W_ADR, PL06_PRODUCT_ID_ADDR,&data); HARDWARE\spl06.c(118): warning: #167-D: argument of type "unsigned char *" is incompatible with parameter of type "int8_t *" IIC_Read_1Byte( W_ADR, PL06_PRODUCT_ID_ADDR,&data); HARDWARE\spl06.c: 3 warnings, 0 errors compiling remote.c... HAL\remote.c(61): warning: #177-D: variable "yaw_ratio" was declared but never referenced const float yaw_ratio = 0.0015f; HAL\remote.c(104): warning: #174-D: expression has no effect IMIT(Remote.roll,1000,2000); HAL\remote.c(106): warning: #174-D: expression has no effect IMIT(Remote.pitch,1000,2000); HAL\remote.c(108): warning: #174-D: expression has no effect IMIT(Remote.yaw,1000,2000); HAL\remote.c(127): warning: #174-D: expression has no effect IMIT(Remote.thr,1000,2000); HAL\remote.c: 5 warnings, 0 errors compiling ANO_DT.c... HAL\ANO_DT.c(77): warning: #177-D: variable "CMD2" was declared but never referenced }CMD2; HAL\ANO_DT.c(571): warning: #174-D: expression has no effect IMIT(Remote.thr,1000,2000); HAL\ANO_DT.c(573): warning: #174-D: expression has no effect IMIT(Remote.yaw,1000,2000); HAL\ANO_DT.c(575): warning: #174-D: expression has no effect IMIT(Remote.roll,1000,2000); HAL\ANO_DT.c(577): warning: #174-D: expression has no effect IMIT(Remote.pitch,1000,2000); HAL\ANO_DT.c(579): warning: #174-D: expression has no effect IMIT(Remote.AUX1,1000,2000); HAL\ANO_DT.c(581): warning: #174-D: expression has no effect IMIT(Remote.AUX2,1000,2000); HAL\ANO_DT.c(583): warning: #174-D: expression has no effect IMIT(Remote.AUX3,1000,2000); HAL\ANO_DT.c(585): warning: #174-D: expression has no effect IMIT(Remote.AUX4,1000,2000); HAL\ANO_DT.c(587): warning: #174-D: expression has no effect IMIT(Remote.AUX5,1000,2000); HAL\ANO_DT.c(589): warning: #174-D: expression has no effect IMIT(Remote.AUX6,1000,2000); HAL\ANO_DT.c: 11 warnings, 0 errors compiling control.c... compiling WIFI_UFO.c... HAL\WIFI_UFO.c(44): warning: #174-D: expression has no effect IMIT(Remote.thr,1000,2000); HAL\WIFI_UFO.c(46): warning: #174-D: expression has no effect IMIT(Remote.yaw,1000,2000); HAL\WIFI_UFO.c(48): warning: #174-D: expression has no effect IMIT(Remote.roll,1000,2000); HAL\WIFI_UFO.c(50): warning: #174-D: expression has no effect IMIT(Remote.pitch,1000,2000); HAL\WIFI_UFO.c(55): warning: #186-D: pointless comparison of unsigned integer with zero IMIT(Remote.AUX2,0,128); HAL\WIFI_UFO.c(55): warning: #174-D: expression has no effect IMIT(Remote.AUX2,0,128); HAL\WIFI_UFO.c: 6 warnings, 0 errors compiling pid.c... compiling imu.c... MATH\imu.c(111): warning: #1-D: last line of file ends without a newline } MATH\imu.c: 1 warning, 0 errors compiling filter.c... compiling ANO_Data_Transfer.c... compiling kalman.c... compiling myMath.c... linking... .\Output\FJCX.axf: error: L6047U: The size of this image (33960 bytes) exceeds the maximum allowed for this version of the linker Finished: 0 information, 0 warning, 0 error and 1 fatal error messages. ".\Output\FJCX.axf" - 1 Error(s), 53 Warning(s). Target not created. Build Time Elapsed: 00:00:04
最新发布
12-03
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值