CDT Codan, Eclipse Indigo Feature #4

June 17, 2011 | 3 min Read

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.

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

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.

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!

Ian Bull

Ian Bull

Ian is an Eclipse committer and EclipseSource Distinguished Engineer with a passion for developer productivity.

He leads the J2V8 project and has served on several …