繁体   English   中英

gcc C ++链接器使“'X'类型与原始声明不匹配”错误?

[英]gcc C++ Linker make “type of 'X' does not match original declaration” an error?

如何使以下链接器警告有关错误的extern声明为错误? 我正在编译和链接gcc版本4.8.3 Sourcery CodeBench

uilding目标:xxxxx.elf调用:Cross ARM C ++链接程序arm-none-eabi-g ++ -mcpu = cortex-m4 -mthumb -mfloat-abi = softfp -mfpu = fpv4-sp-d16 -O0 -fmessage-length = 0- ffunction-sections -fdata-sections -flto -g3 -T“ .. \\ config \\ stm32f4ems \\ STM32F407xG_CCM.ld” -Xlinker --gc-sections -Wl,-Map,“ rusefi.map” -Wl--Map,“ rusefi.map“ -mcpu = cortex-m4 -mthumb -g3...。

xxx.cpp:584:21:警告:“ afrMap”的类型与原始声明不匹配[默认启用]

extern fuel_Map3D_t afrMap;

我希望这不会成功,这样我就不会再错过这个问题了。

尝试使用标志-Werror

从此链接

-Werror
Make all warnings into errors.

编辑:如果您想更具体,可以使用

-Werror=
Make the specified warning into an error. 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM