KEIL技巧之--如何关闭指定编号的警告难题

[复制链接]
7284|8
 楼主| srgr 发表于 2007-9-14 08:31 | 显示全部楼层 |阅读模式
思路一:Options for Target -->BL51 Misc -->disable warning -->输入260  (告警的编号)
编译出现了这样的一个错误;*** FATAL ERROR L227: PARAMETER OUT OF RANGE     delay.obj, flash.obj TO UART0Test0 RAMSIZE (256) DISABLEWARNING (260)#
原来程序都可以正常运行,我故意弄个警告而已,想让这个警告不出现。现在到多出了新的错误。问高手解决方案
Keil BL51 Misc
Disable Warning Numbers 
Enter a comma-separated list of warning numbers to disable. 
Use Linker Control File 
Enables the linker control file. 

网上参考:KEIL 7.50,如何关闭指定编号的警告?没有实现预期效果。keil帮助也没有解决问题


思路二:用#pragma warning(disable:260)也没有达到效果。到增加了新的警告问题。
MAIN.C(16): warning C285: DISABLE:260
#pragma
The #pragma directive specifies compiler directives that may change during program compilation.

#pragma directive « directive ... »
Basically, you place pragmas in your program source code where you want the directive(s) to take effect. Refer to the Cx51 Compiler Directives for a complete list of directives you may specify using #pragma.

上面的描述看不太懂。 VC/C和keil当中有不同。还请哪位高手指教呀。
xwj 发表于 2007-9-14 08:36 | 显示全部楼层

1、不应该关闭警告;2、你那是个错误,不是警告

computer00 发表于 2007-9-14 08:40 | 显示全部楼层

你样做跟掩耳盗铃,画饼充饥一回事

computer00 发表于 2007-9-14 10:47 | 显示全部楼层

直接 #define NULL 0就行。对于0是不会检查类型的。

ayb_ice 发表于 2007-9-14 14:08 | 显示全部楼层

警告是好事

有1,2,3简单的3个级别控制....
没有单个的警告控制...
kukucat 发表于 2007-9-16 11:37 | 显示全部楼层

就是,警告满好的,可以使你以后慢慢改进,又不影响你现

 楼主| srgr 发表于 2007-12-20 16:27 | 显示全部楼层

还是要注意警告号


https://bbs.21ic.com/upfiles/img/200712/20071220162649847.jpg 
 
 楼主| srgr 发表于 2007-12-20 16:36 | 显示全部楼层

图象,比较清楚了



https://bbs.21ic.com/upfiles/img/200712/20071220163542421.jpg
 
https://bbs.21ic.com/upfiles/img/200712/20071220163449424.jpg
 楼主| srgr 发表于 2007-12-20 16:46 | 显示全部楼层

图象怎么不对呢

https://bbs.21ic.com/upfiles/img/200712/20071220163542421.jpg
 
您需要登录后才可以回帖 登录 | 注册

本版积分规则

30

主题

68

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部