当前位置:网站首页>Keil5中如何做到 0 Error(s), 0 Warning(s).
Keil5中如何做到 0 Error(s), 0 Warning(s).
2022-07-01 03:09:00 【风一样的航哥】
使用keil这个软件也有四年多了,从最初的keil4到现在的keil535,编译器从一直使用的V5.06到现在的v6.16,编译速度提升了好多,以前rebuild一次要3分钟多,现在只需要13s,真的是极大减小了摸鱼的时间。
keil的安装和破解都是基本操作,推荐大家使用keil5.3以上的版本,这样就可以使用默认的v6.16编译器了。

那如何做到没有错误和警告呢,首先要强迫自己不能接受任何错误和警告,否则就无法写出优秀的代码(至少在编译器眼里)。
面对错误,我们必须改正,否则程序不能运行,在这个编译器里面C++函数如果不是void类型,那么必须有返回值,否则会报错。对比v5编译器,只是一个警告而已。其他错误按照C++语法规则修改即可。
面对警告,很多人选择了忽略,但是我是不能容忍的,要消除警告。大部分警告是可以消除的,面对消除不了的警告,只能上绝招了。

在图中屏蔽了两个警告,分别是源文件编码和C语言下有符合指针和无符号指针的转化。
如果打开工程后,#include “xxx”前面有红叉,问题描述为多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符,说明工程路径包含中文,需要修改掉路径的中文,因为这个编译器对中文支持还不是很好。
许多博客里面提到了关闭动态语法检查,我非常不建议这么操作,因为软件提示的地方可能真的是有错的地方。
在刚升级到AC6.13的时候,发现很多地方明明没有错误,但是前面会有红叉,我的理解是这个编译器无法自动识别C++和C的头文件,也就是都是.h文件,默认按照C语言处理,这样虽然编译可以通过,但是看起来十分难受,折腾了半天之后,选择了升级编译器,单独升级编译器之后,直接破解编译器就会造成keil未破解的尴尬局面。。。最后升级了keil版本,解决了问题。
当看到这样的时候,内心觉得爽。(个人电脑是12年的老古董了,编译用了33s)

总结来说:1,升级keil版本,建议使用ac6.16编译器;2,修改全部的错误;3,修改可以修改的警告,修改不了的屏蔽掉。4,还有其他问题,查资料吧。
边栏推荐
- 【小程序项目开发-- 京东商城】uni-app之首页商品楼层
- 【小程序项目开发 -- 京东商城】uni-app 商品分类页面(下)
- Catch 222222
- MCU firmware packaging Script Software
- C # realize solving the shortest path of unauthorized graph based on breadth first BFS -- complete program display
- Poj-3486-computers[dynamic planning]
- 数组的includes( )
- EtherCAT原理概述
- JS to find duplicate elements in two arrays
- Multithreaded printing
猜你喜欢

Restcloud ETL practice to realize incremental data synchronization without identification bit

STM32——一线协议之DS18B20温度采样
![Od modify DLL and exe pop-up contents [OllyDbg]](/img/ff/7249e6e6644376ae048b23bf63b046.jpg)
Od modify DLL and exe pop-up contents [OllyDbg]

C#实现基于广度优先BFS求解无权图最短路径----完整程序展示

HTB-Lame

Let's just say I can use thousands of expression packs
![[small program project development -- Jingdong Mall] the home page commodity floor of uni app](/img/80/20bed20a6ab91e82ad6800b11f2caa.png)
[small program project development -- Jingdong Mall] the home page commodity floor of uni app

Latest interface automation interview questions

Huawei operator level router configuration example | configuration static VPLS example

How do spark tasks of 10W workers run? (Distributed Computing)
随机推荐
Metadata in NFT
别再说不会解决 “跨域“ 问题啦
JUC learning
【小程序项目开发 -- 京东商城】uni-app 商品分类页面(上)
Nacos
Restcloud ETL practice to realize incremental data synchronization without identification bit
lavaweb【初识后续问题的解决】
How do spark tasks of 10W workers run? (Distributed Computing)
Cloud native annual technology inventory is released! Ride the wind and waves at the right time
Introduction and basic knowledge of machine learning
Cloud native annual technology inventory is released! Ride the wind and waves at the right time
性能测试常见面试题
EtherCAT原理概述
Error accessing URL 404
几行事务代码,让我赔了16万
Redis 教程
CX5120控制汇川IS620N伺服报错E15解决方案
Druid监控统计数据源
Borrowing constructor inheritance and composite inheritance
Redis高效点赞与取消功能