CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

static c source code analysis

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
cfernandez



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

static c source code analysis
PostPosted: Fri Aug 24, 2012 3:00 pm     Reply with quote

Any know a tool for static c code analysis that work with CCS?

Best Regards,
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Aug 24, 2012 4:01 pm     Reply with quote

The CCS IDE has these features listed:
http://www.ccsinfo.com/content.php?page=ideoverview#calc

http://www.ccsinfo.com/content.php?page=code_metrics&navcode=/metrics
cfernandez



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

PostPosted: Fri Aug 24, 2012 4:20 pm     Reply with quote

Dear PCM

thanks but I want a tool for control and check my code, for example:

Code:
void x( int a )
{
   *a=4;
}

main( )
{
 int b;

  x( &b );
}


Is this example the compiler not detect error.

I want a tool for check this stupid error.....

Best Regards,
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Aug 24, 2012 5:07 pm     Reply with quote

You need a Lint program. About 12 years ago I made LClint work with
CCS, but I only used it for one project and I haven't used or tested it
since that time. So, I don't really have an recommendations for a lint program.
cfernandez



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

PostPosted: Fri Aug 24, 2012 6:03 pm     Reply with quote

I search in the web, if I found any I tell you...

Thanks!!!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Sat Aug 25, 2012 3:48 am     Reply with quote

Problem is, that though possibly 'silly', it _is_ legal in C.

Remember C is basically an 'untyped' language with automatic casting between types. You can use a pointer as an integer, and an integer as a pointer. In fact if the variable was an int16, it'd work!. The only reason it won't, is that it throws away the top byte of the variable when it is passed...

Do your search for 'PCLint', which is a tool for picking up loose bits of 'fluff' in C. There is a stricter version 'plint', which will point out things that _might_ be bugs, like the one you post. However quite a bit of configuration will be needed, to code with the CCS peculiarities, like the size of the integer, and the restrictions on pointers to functions.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group