Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 07:24 Go to next message
hanno  is currently offline hanno Friend
Messages: 2
Registered: December 2011
Junior Member
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 12:16 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
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


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Static check of identifier length [message #760368 is a reply to message #760128] Fri, 02 December 2011 08:10 Go to previous messageGo to next message
hanno  is currently offline hanno Friend
Messages: 2
Registered: December 2011
Junior Member
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 12:18 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
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.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:Fixing broken eclipse projects
Next Topic:Problems using the Debug Mode in Indigo
Goto Forum:
  


Current Time: Fri Mar 29 09:25:02 GMT 2024

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

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

Back to the top