CDT Codan, Eclipse Indigo Feature #4

The C/C++ Tooling for Eclipse is old Mature! In fact, the first bug report filed against the CDT was opened on January 14th 2002, Only a few months after Eclipse 1.0 shipped.  If my trivia knowledge is correct, the CDT is the oldest Eclipse project (next to the Eclipse IDE itself) and it has grown into a first class C/C++ IDE.

As with all previous release trains, the CDT is on board and ready to ship some awesome new features.  As we approach yet another Eclipse release, I’ve been counting down my top 10 favorite features.  The C/C++ Code Analysis is number 4 on my list.

C++ is hard to parse!  And when languages are hard to parse, it’s very hard to develop solid tool support for them.  In many cases. parsing the language requires a full compile step which would not be feasible for the type of real-time feedback expected by developers.  (During my Master’s degree (2001) we ripped the front end off of GCC to create a C++ fact extractor called CPPX [ref, ref], but incremental updates still required a full re-run of the tool, not acceptable if you are looking for errors as you type.)

Now, throw in the fact that C++ accepts input that can result in infinite recursion, and you have a challenge :-).

Feed this to your favorite C++ parser and see what happens [ref,ref]

template<class T> struct Loop { Loop<T*> operator->(); };
Loop<int> i, j = i->hooray;

Luckily for C++ developers, the Eclipse CDT has leapt past this hurdle and produced a pretty awesome Code Analysis tool, (Codan) which is no easy feat!  This tool will now reveal many static analysis problems while you type.

SemanticProblems CDT Codan, Eclipse Indigo Feature #4

This opens up the door for many advanced IDE features such as quick fixes, detection of unused functions, suspicious semicolons and more.

CDTNameResolutionFix CDT Codan, Eclipse Indigo Feature #4

Kudos to this work goes out to Alena Laskavaia with help from Sergey Prigogin .

In addition to Codan, there are a number of exciting new features in the CDT this year.  A really cool feature is project-less debugging. This allows you to use the CDT for debugging without actually using the tool for your development.  This type of feature will greatly help adoption as it lowers the barrier to entry.

Noprojectdebug CDT Codan, Eclipse Indigo Feature #4

For a complete list of New and Noteworthy features in the CDT, checkout their wiki page.

A big thank-you for all this work goes out to Doug Schaefer, the CDT team lead and the rest of the CDT team:

James Blackburn, Patrick Chuong, John Cortell, David Dubrow, Emanuel Graf, Andrew Gvozdev, Mikhail Khodjaiants, Marc Khouzam, Vivian Kong, Mike Kucera, Marc-Andre Laperle, Alena Laskavaia, Toni Leherbauer, Teodor Madan, Pawel Piech, Sergey Prigogin, Chris Recoskie, Randy Rohrbach, Ken Ryall, Markus Schorn, Ed Swartz and Ling Wang.  Great work everyone!

One Response to “CDT Codan, Eclipse Indigo Feature #4”

  1. Tomasz Wesolowski says:

    I’m very glad you like it! Codan is still under active development, so make sure to watch the newest releases or possibly nightly builds from Eclipse Git to have the most of it. :)

One response so far

Written by . Published in Categories: EclipseSource News, Planet Eclipse

Author:
Published:
Jun 17th, 2011
Follow:

Twitter LinkedIn Google+ GitHub