/ctlutil.h(278) : error C4430: missing type specifier - int assumed.

本文解决了一个在从VC6迁移到VS2005/2008/2010过程中出现的C++编译错误。该错误发生在没有明确指定返回类型的函数定义中,解决方法是在项目的编译命令行中加入/wd4430选项。

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

/ctlutil.h(278) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
BaseClasses/ctlutil.h(278) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
错误发生在:operator=(LONG); 函数定义中,这是因为在VC6中,如果没有显示的指定返回值类型,编译器将其视为默认整型;
但是VS2005,VS2008,VS2010不支持默认整型. 这个错误,解决方法如下:
打开project->BaseClasses properties->configuration->C/C++ ->Command Line,增加/wd4430选项。
*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Build target 'LL' compiling sys.c... sys.c(3): error: #79: expected a type specifier LL_APB2_GRP1_EnableClock( L_APB2_GRP1_PERIPH_SYSCFG); sys.c(3): error: #260-D: explicit type is missing ("int" assumed) LL_APB2_GRP1_EnableClock( L_APB2_GRP1_PERIPH_SYSCFG); sys.c(3): error: #147: declaration is incompatible with "void LL_APB2_GRP1_EnableClock(uint32_t)" (declared at line 1427 of "../Drivers/STM32G4xx_HAL_Driver/Inc/stm32g4xx_ll_bus.h") LL_APB2_GRP1_EnableClock( L_APB2_GRP1_PERIPH_SYSCFG); sys.c(4): error: #79: expected a type specifier LL_APB1_GRP1_EnableClock( L_APB1_GRP1_PERIPH_PWR); sys.c(4): error: #260-D: explicit type is missing ("int" assumed) LL_APB1_GRP1_EnableClock( L_APB1_GRP1_PERIPH_PWR); sys.c(4): error: #147: declaration is incompatible with "void LL_APB1_GRP1_EnableClock(uint32_t)" (declared at line 913 of "../Drivers/STM32G4xx_HAL_Driver/Inc/stm32g4xx_ll_bus.h") LL_APB1_GRP1_EnableClock( L_APB1_GRP1_PERIPH_PWR); sys.c(6): error: #79: expected a type specifier VIC_SetPriorityGrouping( VIC_PRIORITYGROUP_4); sys.c(6): error: #260-D: explicit type is missing ("int" assumed) VIC_SetPriorityGrouping( VIC_PRIORITYGROUP_4); sys.c(6): error: #147: declaration is incompatible with "void __NVIC_SetPriorityGrouping(uint32_t)" (declared at line 1648 of "../Drivers/CMSIS/Include/core_cm4.h") VIC_SetPriorityGrouping( VIC_PRIORITYGROUP_4); sys.c(8): warning: #1295-D: Deprecated declaration LL_PWR_DisableUCPDDeadBattery - give arg types LL_PWR_DisableUCPDDeadBattery(); sys.c(8): error: #260-D: explicit type is missing ("int" assumed) LL_PWR_DisableUCPDDeadBattery(); sys.c(8): error: #147: declaration is incompatible with "void LL_PWR_DisableUCPDDeadBattery(void)" (declared at line 496 of "../Drivers/STM32G4xx_HAL_Driver/Inc/stm32g4xx_ll_pwr.h") LL_PWR_DisableUCPDDeadBattery(); sys.c(40): warning: #1295-D: Deprecated declaration LL_SYSTICK_EnableIT - give arg types LL_SYSTICK_EnableIT() ; sys.c(40): error: #260-D: explicit type is missing ("int" assumed) LL_SYSTICK_EnableIT() ; sys.c(40): error: #147: declaration is incompatible with "void LL_SYSTICK_EnableIT(void)" (declared at line 271 of "../Drivers/STM32G4xx_HAL_Driver/Inc/stm32g4xx_ll_cortex.h") LL_SYSTICK_EnableIT() ; sys.c: 2 warnings, 13 errors "LL\LL.axf" - 13 Error(s), 2 Warning(s). Target not created. Build Time Elapsed: 00:00:03
最新发布
08-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值