tags:

views:

81

answers:

5
+1  Q: 

c / c++ diff tool

Possible Duplicate:
Do you know of any language-aware diffing tools?

Hey Guys

I am after a differencing tool that supports the following
Ignore all white spaces
Has option to show differences only
Can ignore comments
Can do File and Folder compares

Would prefer an open source solution

Cheers

+2  A: 

Try a graphical diff program such as meld or kdiff3. They tend to be very powerful.

I assume from the body of your question that you want a complete tool, not a C/C++ API, as your title would lead me to believe.

Borealid
+1  A: 

SmartSynchronize is the best you can get. It's commercial, but if fulfills all your requirements (except comment ignore) but it does more, like:

  • 3-way merge
  • inner-line change detection and edit
  • support for profiles.
  • file filters
  • directory filters
  • support for different encodings (e.g. to be able to compare even when they're different)

The main advantage of it and all other "Smartxxx" products developed by that small German company is their extreme user friendliness, and their price is merely the price of usual IT books - so from my standpoint it was one of my best investments so far - but I'm using them every day too, so maybe I'm biased from this standpoint.

A. Ionescu
A: 

You can try Guiffy

shk
+1  A: 

Winmerge is really good if you're on Windows. It allows you to compare files or directories and push the differences to one file or the other. White space can be ignored or included as you wish.

Matt_JD
A: 

The SD Smart Differencer is a family of comparison tools that compares individual files according to the the language syntax of the file, using the program syntax. This means it ignores language-defined whitespact and language-defined comments. It will match files with different formatting if they contain the same code.

Where there are differences, they are reported in language terms, e.g., expressions, statements, blocks, ... and in terms of editing actions that a programmer might reasonably do (move, delete, insert, copy, rename).

Because macros and preprocessor directives tend to be used abusively in raw C files (ruining the apparant program structure as seen by the language grammar), it does not operate as well on C files as one would like. It does quite well with files that do not have, or have little preprocessing, such as C++, C#, Java, COBOL, Python, ...

It doesn't compare file folders, just individual pairs of files. Not open source.

Ira Baxter