ansi c code testing

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?

Reply to
praveen
Loading thread data ...

Polyspace make a very powerful tool but it is quite pricey (GBP4k IIRC). You can get a lot done with static analysis using Lint

formatting link
It won't pick up run-time errors but it will give plenty of clues as to where they might occur.

Reply to
Tom Lucas

In article , praveen writes

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 \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Reply to
Chris Hills

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.

That sounds about right.

Good suggestion, as well as studying C textbooks and the C FAQ to better understand the language.

--
Thad
Reply to
Thad Smith

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?
>
Reply to
Adib Taraben

In article , Adib Taraben writes

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.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
/\/\/ chris@phaedsys.org      www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Reply to
Chris Hills

Op Fri, 15 Dec 2006 14:23:07 +0100 schreef Chris Hills :

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/
Reply to
Boudewijn Dijkstra

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.