[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [API] r18266

From: Greg Stein <gstein_at_lyra.org>
Date: 2006-02-04 22:38:13 CET

On Sat, Feb 04, 2006 at 10:23:16PM +0100, Branko ??ibej wrote:
>...
> >>>>Peter N. Lundblad wrote:
> >>>>>I don't understand the above. If we forbid users to allocate this
> >>>>>struct,
> >>>>>we can freely add fields in the future without problems. Or do you

We've stated this before around structures. We've also moved to use
more factory functions so that we don't always have to make such
statements (which are hard to enforce).

>...
> >I don't think it does either us, or the clients of our libraries, to
> >avoid a little API revving if the cost is the potential for obscure and
> >hard-to-detect bugs. I suggest simply contracting to rev the API
> >whenever the structure changes (it's not that hard, after all).

It gets ugly to keep creating foo2, foo3, ...

> We have version checks that enforce the compatibility rules.

Only for well-behaved clients that call those functions. The version
rules were also designed to make it "just work" for any client.

In any case, a strict reading of the version rules would forbid adding
fields to a structure. But it is also legal to say "don't alloc these
yourself" and that escapes the API rules. I don't have any opinion
here, but would tend to recommend factory functions and mandate
clients use those rather than their own allocations (on heap or stack).

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Feb 4 22:34:25 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.