EmbeddedRelated.com
Forums
Memfault Beyond the Launch

ansi c code testing

Started by praveen December 15, 2006
Hi,

I am writing c code for ATMEL 8051 core in ANSI c. we are using KEIL
compiler for it. I want to test my c code and improve my programming
skills.  Can any one suggest the software tool that can test my c code
for runtime errors?

"praveen" <praveen.hpl@gmail.com> wrote in message 
news:1166165669.266815.37140@16g2000cwy.googlegroups.com...
> > Hi, > > I am writing c code for ATMEL 8051 core in ANSI c. we are using KEIL > compiler for it. I want to test my c code and improve my programming > skills. Can any one suggest the software tool that can test my c code > for runtime errors?
Polyspace make a very powerful tool but it is quite pricey (GBP4k IIRC). You can get a lot done with static analysis using Lint (www.gimpel.com). It won't pick up run-time errors but it will give plenty of clues as to where they might occur.
In article <1166165669.266815.37140@16g2000cwy.googlegroups.com>, 
praveen <praveen.hpl@gmail.com> writes
> >Hi, > >I am writing c code for ATMEL 8051 core in ANSI c. we are using KEIL >compiler for it. I want to test my c code and improve my programming >skills. Can any one suggest the software tool that can test my c code >for runtime errors? >
1 You are actually using C51 which is Keil's own version of C. It is ISO C with some bits missing and some extensions. 2 ANSI C was superseded by ISO C in 1990. The C standard is ISO C (ISO 9899:1999) . 3 You need to do static analysis before you get to dynamic analysis. Static analysis will improve your C. dynamic analysis will probably improve your design skills rather than C skills. there are tools from "FREE" to very expensive. The Keil uVision is pre set to use Gimple's PC-lint which is a very good tool. After that you have more expensive tools like Programing Research's QAC and Polyspace etc. For dynamic testing there are the LDRA tools. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Chris Hills wrote:

>> I am writing c code for ATMEL 8051 core in ANSI c. we are using KEIL >> compiler for it. I want to test my c code and improve my programming >> skills. Can any one suggest the software tool that can test my c code >> for runtime errors?
> 2 ANSI C was superseded by ISO C in 1990. The C standard is ISO C (ISO > 9899:1999) .
That's part of the story. ANSI first standardized C, which ISO adopted. The ISO versions were then adopted as ANSI standards, so there really is a current ANSI C standard that is the same as ISO C.
> 3 You need to do static analysis before you get to dynamic analysis. > Static analysis will improve your C. > dynamic analysis will probably improve your design skills rather than C > skills.
That sounds about right.
> there are tools from "FREE" to very expensive. The Keil uVision is pre > set to use Gimple's PC-lint which is a very good tool.
Good suggestion, as well as studying C textbooks and the C FAQ to better understand the language. -- Thad
You can also look for some MISRA code checkers. I think that keil as a 
lint tools that does MISRA checks.

such code checkers does not proof your code 100%. You can still do some 
unit conversion wrong as NASA did. But it can help you to prevent from 
common pitfalls. The rules however should be available for public. So 
you can also review your code in your team.

Adib.
---

praveen schrieb:
> Hi, > > I am writing c code for ATMEL 8051 core in ANSI c. we are using KEIL > compiler for it. I want to test my c code and improve my programming > skills. Can any one suggest the software tool that can test my c code > for runtime errors? >
In article <4583f81d$0$5716$9b4e6d93@newsspool3.arcor-online.net>, Adib 
Taraben <theAdib@yahoo.com> writes
>You can also look for some MISRA code checkers. I think that keil as a >lint tools that does MISRA checks.
You need a static analyser. Most of them check for MISRA-C these days The Keil uV3 is set up to use Gimpel's PC-lint. This will do good static analysis and can check for MISRA-C 1 or C2 I am told the MISRA-C:2004 is a good guide for C programming.
>such code checkers does not proof your code 100%. You can still do some >unit conversion wrong as NASA did. But it can help you to prevent from >common pitfalls. The rules however should be available for public. So >you can also review your code in your team. > >Adib. >--- > >praveen schrieb: >> Hi, >> I am writing c code for ATMEL 8051 core in ANSI c. we are using KEIL >> compiler for it. I want to test my c code and improve my programming >> skills. Can any one suggest the software tool that can test my c code >> for runtime errors? >>
-- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Op Fri, 15 Dec 2006 14:23:07 +0100 schreef Chris Hills  
<chris@phaedsys.org>:
> In article <1166165669.266815.37140@16g2000cwy.googlegroups.com>, > praveen <praveen.hpl@gmail.com> writes >> > For dynamic testing there are the LDRA tools.
Correction: both static and dynamic. And the ability to use information from your static tests in your dynamic tests. -- Gemaakt met Opera's revolutionaire e-mailprogramma: http://www.opera.com/mail/

Memfault Beyond the Launch