1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
是否可以在MPLABX中关闭所有警告?我使用V4.00。如果没有,有一个简单的方法来获得一个错误的列表,而不是警告或一些影响?
以上来自于百度翻译 以下为原文 Is it possible to turn all warnings off in MPLABX? I'm using v4.00. If not is there an easy way to get a list of only the errors and not the warnings or something to this effect? |
|
相关推荐
8个回答
|
|
您应该能够关闭编译器中的警告(哪一个,BTW?)项目选项部分
以上来自于百度翻译 以下为原文 You should be able to turn off warnings in the Compiler (which one, btw?) section of your Project Options |
|
|
|
没有MPLABX无法隐藏警告。这将是编译器的工作。您没有说明正在使用的编译器。如果你这样做,你可以得到一些建议。
以上来自于百度翻译 以下为原文 No MplabX can not hide Warnings. That would be the job of the Compiler. You did not say what Compiler you are using. If you do you could get some advice. |
|
|
|
|
|
|
|
编译器是基于GCC的编译器。您可以为谷歌的各种GCC错误/警告选项。您将在项目选项-gt;xc32 gcc-& gt;附加命令行选项中。我喜欢:-g0- STD= GNU99—FGNU89IN-WFLATE-WINPLING INT- WimPro函数声明WWE未初始化-WNO格式零长度
以上来自于百度翻译 以下为原文 The Compiler is a GCC based Compiler. You can Google for the various GCC Error / Warning options. You would enter them in the Project options->XC32-gcc-> Additional Commanline options. I Like: -G0 -std=gnu99 -fgnu89-inline -Wformat -Wimplicit-int -Wimplicit-function-declaration -Wmaybe-uninitialized -Wno-format-zero-length |
|
|
|
|
|
|
|
你也可以使用Werror。它会把所有的警告变成错误。因此,所有警告都关闭,编译器只向您显示错误。根据你的帖子,这正是你要的…;……)只是开玩笑。我做了经验,而不是隐藏警告,它确实有助于消除警告通过固定代码。其中一些实际上让你意识到真正的问题,如果你仔细观察,只会巧合,甚至在某些情况下会破裂,或者在将来某个时候简单地改变代码后,就会很容易地产生问题。大多数时候,很容易去除警告。我的项目也有很多我一直忽略的警告。但我花了大约一天的时间来摆脱所有这些问题,并对这些原因做了一些研究。一旦你完成了它,那么它就不会努力避免创建新的警告。我的事件又向前迈进了一步,打开了几个额外的错误(-Walth-WiLang-WEPUT)。我只需要删除一些警告类型,它们经常出现在和谐中。因此,我的命令行包括以下内容:-Wrist-Wiel-WuperWNO未使用的参数-WNO忽略限定符-WNO缺失字段初始化器- Wno符号比较-WNO类型限制- -WNO-& LT;选项& GT;选项是仅关闭特定编译器警告的方式。您可以在MPLAXC32 C/C++编译器的用户指南中阅读它,第5.5.5节选项用于控制警告和错误。如果别人给了你一些代码,这会产生很多类型的警告,这可能是更好的方法。注意,MPLAX X还允许您重写单个.c文件的构建选项,并允许您仅在该文件中删除一些警告。
以上来自于百度翻译 以下为原文 You can also use -Werror. It will turn all warnings into errors. Therefore, all warnings are turned off and the compiler only displays errors to you. According to your post, this is exactly what your were asking for ... ;-) .... just kidding. I made the experience, instead of hiding the warning it really helps to remove the warnings by fixing the code. Some of those actually make you aware of real problems, which - if you take a very close look - only work by coincidence or which will even break in certain cases, or will easily create problems after simple changes of the code sometime in the future. Most of the time, it is really easy to remove the warning. My project also had a lot of warnings which I always ignored. But then I have spent roughly one day in total to get rid of all of them, and also do some research about the causes. Once you have done it, then its no effort to avoid creating new warnings. I event went a step further and turned on several additional errors (-Wall -Winline -Wextra). I only had to remove a few warning types, which occurred too often in Harmony. So my command line includes the following: -Werror -Wall -Winline -Wextra -Wno-unused-parameter -Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits The -Wno- |
|
|
|
哈哈,是的,我意识到忽略警告不是最好的做法,我正在从一个和声V1.XX项目升级到一个和谐V2.XX项目,有大约100个警告和80个错误,所以我在寻找一个简单的方法来解决它们。一旦我处理了错误,我会回去处理警告,然后也许我会尝试打开这些额外的警告,你提到,如果我感到特别警惕。
以上来自于百度翻译 以下为原文 Haha, yes I realize ignoring warnings is not the best practice, I am updating from a Harmony v1.XX project to a Harmony v2.XX project and had around 100 warnings and 80 errors so I was looking for an easy way to sort through them. Once I've handled the errors I'll go back and tackle the warnings and then maybe I'll try turning on those additional warnings you mentioned if I'm feeling especially vigilant. |
|
|
|
我会把警告和错误都按顺序进行修复。通常,错误或警告是由代码中的几行错误的东西引起的,因此,寻找比你已经被告知的问题低的问题毫无意义。
以上来自于百度翻译 以下为原文 I'd fix both warnings and errors in order. Quite often an error or warning is caused by something wrong a few lines earlier in the code, so it's pointless searching for problems lower down than where you've already been told there is a problem. |
|
|
|
只有小组成员才能发言,加入小组>>
5238 浏览 9 评论
2028 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3204 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
777浏览 1评论
666浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
595浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
676浏览 0评论
576浏览 0评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 04:34 , Processed in 1.289849 second(s), Total 60, Slave 54 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号