我可以找到嵌入式C代码的分析工具吗? [英] Can I find a analysis tool for embedded C code?

查看:60
本文介绍了我可以找到嵌入式C代码的分析工具吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello, I want to know if there is a really good (yet free) software tool which can analyse my C code (which i have written based on PIC and 8051/52 controllers), can find possible coding mistakes and also check MISRA Compliance...





我尝试过的方法:



我知道PC_LINT,LINT,SPLINT ..

但是从未使用过它们。这些满足这些要求,如果它们是免费的还可以检查MISRA_C合规性吗?



What I have tried:

I know about PC_LINT, LINT, SPLINT..
but never used them..do these fullfuil these requirements and if they are free and can also check MISRA_C compliance?

推荐答案

您将找不到一个好的免费代码分析工具。通常,代码分析包含在您编程的IDE中。



避免错误的最佳方法是拥有一些清晰,简单和简单的程序流程。应该在代码中的输入处检查参数(例如从内存中读取数据时)。



一个非常有用的步骤始终是一些同行评审。当你的同伴理解你的代码时,控制器也可能没问题。



没有代码分析消除你的程序错误 - 对于你需要用(已知的)边缘情况(如(-1,0,)或其他随机输入来编写一些测试函数。模糊测试也是一种选择,但它是一种需要大量准备的profi工具。
You wont find a good and free code analysis tool. Normally code analysis is included in the IDE in which you are programming.

The best way of avoiding bugs is to have some clear, simple and plain program flow. The parameter should be checked at input in your code (like when data is read from memory).

A very helpful step is always some peer review. When your peer understands your code than the controller may also be fine with it.

No code analysis will eliminate the bugs your program - for that you need to write some test functions with (known) edge cases like (-1, 0, "") or other random input. Fuzzing is also an option but it is a profi tool which need a lot of preparement.


这篇关于我可以找到嵌入式C代码的分析工具吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆