如何在每次出现“函数的隐式声明”时启用警告?
我在代码中第一次出现时得到“函数的隐式声明”,但其他出现的情况没有突出显示,我想立即查看所有这些情况。如下图所示。
我正在使用:ARM 嵌入式处理器的 GNU 工具 (arm-none-eabi-gcc) 版本:2.4-201503242026
writeReg(ADDR_IP_TR0,saved_TR0); <------ There is implicit declaration of function
writeReg(ADDR_IP_TR2,saved_TR2); <------ Nothing
writeReg(ADDR_IP_TR3,saved_TR3); <------ Nothing
writeReg(ADDR_IP_TR5,saved_TR5); <------ Nothing
writeReg(ADDR_IP_TR9,saved_TR9); <------ Nothing
我正在寻找能够突出显示所有出现的开关,如下所示:
writeReg(ADDR_IP_TR0,saved_TR0); <------ There is implicit declaration of function
writeReg(ADDR_IP_TR2,saved_TR2); <------ There is implicit declaration of function
writeReg(ADDR_IP_TR3,saved_TR3); <------ There is implicit declaration of function
writeReg(ADDR_IP_TR5,saved_TR5); <------ There is implicit declaration of function
writeReg(ADDR_IP_TR9,saved_TR9); <------ There is implicit declaration of function
我发现标志 -Werror-隐式函数声明
会将这个特定警告转换为错误。
如果您知道如何执行此操作,请告诉我。
I get "implicit declaration of function" for first occurrence in code but the other occurrences are not highlighted I would like to se all of them at once. As shown below.
I am using: GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc) Version: 2.4-201503242026
writeReg(ADDR_IP_TR0,saved_TR0); <------ There is implicit declaration of function
writeReg(ADDR_IP_TR2,saved_TR2); <------ Nothing
writeReg(ADDR_IP_TR3,saved_TR3); <------ Nothing
writeReg(ADDR_IP_TR5,saved_TR5); <------ Nothing
writeReg(ADDR_IP_TR9,saved_TR9); <------ Nothing
I am looking for switch that will enable highlighting of all occurrences like this:
writeReg(ADDR_IP_TR0,saved_TR0); <------ There is implicit declaration of function
writeReg(ADDR_IP_TR2,saved_TR2); <------ There is implicit declaration of function
writeReg(ADDR_IP_TR3,saved_TR3); <------ There is implicit declaration of function
writeReg(ADDR_IP_TR5,saved_TR5); <------ There is implicit declaration of function
writeReg(ADDR_IP_TR9,saved_TR9); <------ There is implicit declaration of function
I have found that flag -Werror-implicit-function-declaration
will turn this specific warning in to an error.
If you know how to do this please let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在第一个“隐式声明”之后,现在声明(隐式)已调用的函数。因此,后续调用不会导致该警告,因为该函数已在那时声明。 ——阿德里安·莫尔
After the first "implicit declaration" the function that has been called is now declared (implicitly). So, subsequent calls don't cause that warning because the function is by then declared. – Adrian Mole