完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我已经安装了XPLABX 5和新的2编译器。这似乎是一个旨在合并PIC和AVR开发的版本,我没想到PIC部分会有很多变化。所以我把我的一个项目迁移到新的IDE中,只是发现C99选项在1.45.1下编译的代码中产生了很多错误,所以我回到了MO。重新保守的C90选项,我发现旧语法的一部分仍然没有被新编译器识别。这是我最讨厌的事情之一,那就是打破曾经的标准,而不给出一个关于将要被破坏的明确警告和一个关于如何修复它的简单指南。我必须用“新”ySyButter()指令修改中断定义(对于这种f的外部声明)。UNIOSITY中断()被编译器认为是无用的加法,所以我必须删除它们,以及使用@的绝对置位常数。这可能是一个很容易的事情,谁学习编译器选项和所有的变种和替代的壁炉,但那些不包括(包括我)寻找替代语法是耗时的。顺便说一下,在项目结束编译,但我不能使编译器认识到-味精禁用选项,我找不到该功能的任何替代语法。如何用新编译器抑制烦人的3625201498警告消息?提前感谢
以上来自于百度翻译 以下为原文 I've installed XPLABX 5.0 and the new 2.00 compiler. Seen that is seems a release aimed at merging PIC and AVR development, I didn't expect many changes for the PIC part. So I migrated a projects of mine to the new IDE just to discover that the C99 option produces a lot of errors with the code that compiled perfectly under 1.45. So I returned to the more conservative C90 option and I found that part of the old syntax was still not recognized by the new compiler. This is one of the things that I hate most, that is breaking what was once standard without giving an explicit warning on what is going to be broken and an easy guide on how to fix it. I had to modify the interrupt definitions with the "new" __interrupt() directive (for extern declarations of such functions __interrupt() is considered a useless addition by the compiler so I had to remove them) and the absolute placed constants that used @. It may be an easy thing for who learns the compiler options and all their variants and alternatives by hearth, but for those that do not (included me) looking for the alternative syntax is time consuming. By the way, at the end the project compiles, but I cannot make the compiler recognize the --MSGDISABLE option and I could not find any alternative syntax for that functionality. How can I suppress the annoying 362,520,1498 warnings messages with the new compiler? Thanks in advance |
|
相关推荐
2个回答
|
|
|
老实说:声明ISR外部是无稽之谈,一直以来都是:你不能调用它们,而不使用@外部声明是不太有用的。为什么不适当设置“警告级别”呢?(编译器选项中的“某处”)或学习如何编写不被十二个线程发出警告的代码?(根据我的经验,一些警告不能被消除。但是大多数都会消失。
以上来自于百度翻译 以下为原文 Honestly: declaring ISRs external is nonsense and has always been: you cannot call them. And not having the @ for external declarations is hardly more useful. --MSGDISABLE ? Why not set the "warning level" appropriately ? ("somewhere" in the compiler options) Or learn how to write code that doesn't throw warnings by the dozen? (OK - according to my experience, some warnings cannot be eliminated. But the majority will vanish with proper coding.) |
|
|
|
|
|
????我在一个单独的模块中具有IRS功能,这些函数在调用它们的另一个.c文件中被声明为外部(这是因为声明是框架的预定义模块的一部分,而ISR是用户可定义的)。你怎么会想到那些功能不能被这样称呼?@不是用于外部变量,而是用于在HEX分析的相同地址中总是找到的常量。我可以正确地编写代码,比您能想到的要好得多,但是对于每个和在库中定义但未被调用的所有函数发出警告只是简单的。nnink,这是相对于任何指针可能没有目标的事实的警告(即使你写指针= ANABOXTETEL地址,然后*指针=0),警告你一些移位是不合适的(即使它们在逻辑观点下是正确的),尽管编译器用一个固定的和不变的算术角度来看待它们,或者那些TAT告诉我,零移不产生代码(如果我使用定义或枚举或索引作为移位值,我不检查移位的零值,以避免无用的警告,是吗?)删除那些恼人的警告并不意味着我也想删除其他可能在同一个级别上有意义的警告。BTW:在全局选项的附加选项中使用-MSGDABLE选项确实可以抑制警告,但是编译器哀叹该选项不被重新编码。Neal:同样的,如果选项是大写的,OpTunUnDebug也不被识别(虽然我没有测试IRQ是否被正确地忽略或忽略)如果选项是小写的,同样,最后但不是最不重要的一点是,改变项目配置需要很多,有时会完全冻结IDE。
以上来自于百度翻译 以下为原文 ??? I have IRS functions in a separate module and those functions are extern declared in another .c file that calls them (that's because the declaration are part of a predefined module of a framework while the ISR are user definable). How do you come to the idea that those functions cannot be called that way? @ was not used for external variables, but for constants that must be always found at the same address for HEX analysis. I can properly write code much better than you can think, but having warning that is issued for each and all functions that are defined in a library but are not called is simply annoying, as is the warning relative to the fact that whatever pointer may have no target (even if you write pointer = anAbsoluteAddress and then *pointer = 0) as is the one that warns you that some shiftings are not appropriate (even though they are correct under a logical point of view, though the compiler sees them with a fixed and unchangeable arithmetic point of view) or those tat tells me that shifting by zero produces no code (if I use defines or enums or indexes as shifting value I do not check for shiftings by zero values to avoid the useless warning, do you?). Removing those annoying warning does not mean I want to remove also the other ones at the same level that may have a meaning. BTW: the warning are indeed suppressed with the use of the --MSGDISABLE option in Additional options of Global options, but the compiler laments that the option is not recognized: ::: warning: (2044) unrecognized option "--msgdisable=362,520,1498" Same if the option is uppercase. Also the option UNDEFINTS is not recognized (though I have not tested if the IRQs are correctly ignored or not) ::: warning: (2044) unrecognized option "--UNDEFINTS=ignore" Same if the option is lowercase. Last but not least, changing the project configuration takes a lot and sometimes freezes completely the IDE. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475 浏览 0 评论
5795 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1125浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1098浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 23:48 , Processed in 0.691171 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2144