Archive for August, 2007

Splint and variadic macros

It would be very worthwhile for someone to add support for variadic macros to Splint (a C static analysis tool similar to lint but better). While it is not as good as Coverity Prevent and generates several false positives, it can be made to work with GLib/GTK+ application code and would be very helpful in eliminating several types of programming errors. It is certainly much better than lint. It has been used on GIMP trunk, along with other static analysis tools and it found errors which were fixed. Another tool called href=”http://www.cubewano.org/oink”>Oink doesn’t compile on my x86_64 box, but seems interesting nevertheless as it claims to support C++.

I dream of a day when C/C++ programmer editors do static analysis as I type, and suggest corrections to stupid mistakes. NetBeans (Java) has really spoiled me, by how productive one can be using it.

Subversion and merging

Subversion’s lack of good merging support is proving to be difficult. Over the last 2 weeks, my colleagues and I have been bitten by at least the following issues (perhaps due to our arrangement of branches which make these issues conspicuous):

  • The multiple merge problem which is documented in the Subversion manual: create a branch and when you merge from one to another more than once, you have to 1. record the number of the revision you’re merging upto in the commit log, and 2. supply this revision number when you merge the next time. Otherwise, if you have changed some lines that were brought in when you merged last, you will get conflicts. And be careful when recording the point you merged till if you are looking up its revision number again, as the from-branch may have more revisions since you merged. Cherry picking is also not possible unless you track every changeset you merged.
  • You may have to resolve the same conflict again when merging into a working copy from your colleauge’s branch, even if your colleaugue already merged your latest changes, picked his change over yours in that conflict in his working copy and committed this into his branch. Subversion does not seem to be able to record and use this info.
  • If multiple developers merge into their checkout of trunk and commit into trunk, from their private/topic branches in an office environment where merging can happen often, these merges may happen at nearby times. In some of these cases, you may reverse out some changes of your colleagues without any warning even though you ran svn up before you committed. When I hit this issue, I started wondering if this was the reason for Git’s index (I never quite followed the need for it).