Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Static check of identifier length(Static analysis or plugin?)
Static check of identifier length [message #760065] Thu, 01 December 2011 02:24 Go to next message
Eclipse UserFriend
Hi there,

Could not find anything that comes near to what I need.

We're using eclipse/cdt for embedded SW development with C.

We have some coding rules that limit the length allowed to be used for any identifier (variable, function, macros). Is there a way to add a style check for this rule to be checked while entering code. Just like the static code analysis.

If not I would create something like that. I'm really starting with creating stuff for eclipse. Until now everything was about configuration.
Whats best approach in terms of effort and user experience:
-> Extend the static code analysis functionality
-> Create a plugin that does the check

Thank you for your help,
Hanno.
Re: Static check of identifier length [message #760128 is a reply to message #760065] Thu, 01 December 2011 07:16 Go to previous messageGo to next message
Eclipse UserFriend
There is CODAN (integrated static code analyser) rule to check function names
Preferences->C/C++->Code analysis->Coding style: Name convention for functions

You can replace the default regexp with
^.{1,15}$

This would limit the function name length to 15 characters.
If you need code style checkers for variables, macros etc. you must create your own CODAN checker.
http://wiki.eclipse.org/CDT/designs/StaticAnalysis
http://www.slideshare.net/laskava/eclipse-con2011-v11
Re: Static check of identifier length [message #760368 is a reply to message #760128] Fri, 02 December 2011 03:10 Go to previous messageGo to next message
Eclipse UserFriend
Thank you Axel.

Next week I start adding the code checkers for our identifier naming rules.

Additionally there is the persistent request for a display of the text selection length. Embedded inside the bottom bar, right beside the current cursor position.
I don't think there is something like that in eclipse, am I wrong?

Once again thanks.
Re: Static check of identifier length [message #760836 is a reply to message #760368] Mon, 05 December 2011 07:18 Go to previous message
Eclipse UserFriend
hanno wrote on Fri, 02 December 2011 09:10

Additionally there is the persistent request for a display of the text selection length. Embedded inside the bottom bar, right beside the current cursor position.
I don't think there is something like that in eclipse, am I wrong?

I don't think this feature is implemented. But it sounds cool. When you open a bugzilla request I would add my vote.
Previous Topic:Fixing broken eclipse projects
Next Topic:Problems using the Debug Mode in Indigo
Goto Forum:
  


Current Time: Sat Jul 05 01:07:24 EDT 2025

Powered by FUDForum. Page generated in 0.06256 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top