TTree produced with one ROOT ver has problems with other ver

Dear ROOT experts,

I am frequently using the same strategy to add more variables to an existing tree, or to change variables which are already in the tree. I attach a directory rootbug, the file maniptree_x.cpp should illustrate my method.

My problem is: I setup ROOT v4.03.04, execute maketree_x and maniptree_x subsequently; then, I setup ROOT v4.01.04a, and when I now open the root file, root -l tree.root, I get error messages like the following:

Error in <TBuffer::CheckByteCount>: object of class TLeaf read too few bytes: 40 instead of 42 Error in <TStreamerInfo::ReadBuffer>: The element TLeaf::fIsRange type 218 (Bool_t) is not supported yet
I think this problem is not specific to these two particular versions, but that is what I had been using. Can somebody explain me what this is about? Something wrong in the way these trees are created/manipulated, or is this a ROOT bug? Clearly, the ROOT data files should be readble by any version, regardless of the version used for the production of the file?

Thanks a lot,

rootbug.tar.gz (2.13 KB)

We garantee that a ROOT file produced by version N can always be
read by version N+1, N+2, etc.
However, we cannot garantee forward compatibility, ie that an old version
of ROOT reads a file produced by a newer version. We try to do our best
in this direction, but cannot take any commitment.