ldb_handler_fold: public or private?
idra at samba.org
Mon Mar 21 06:43:24 MDT 2011
On Mon, 2011-03-21 at 13:30 +0100, Jelmer Vernooij wrote:
> On Mon, 2011-03-21 at 08:19 -0400, simo wrote:
> > On Sat, 2011-03-19 at 16:00 +0100, Jelmer Vernooij wrote:
> > > ldb_handler_fold is a convenience function that is used in
> > > source4/lib/ldb/common/attrib_handlers.c. It is currently public, but
> > > not declared in any header files. As far as I can tell it's just a
> > > trivial convenience function that was never intended to be public.
> > >
> > > However, as it is public it is technically part of our ABI.
> > >
> > > We can:
> > >
> > > 1) make it static (so the symbol is no longer exported)
> > > 2) keep it public and add it to one of the headers
> > > 3) keep it public but add a comment to remove it whenever we get a
> > > chance
> > >
> > > Is ldb_handler_fold useful for external users? How harmful would it be
> > > to remove it now, given that it's not in any public header and nobody
> > > should be using it?
> > Does samba4 use it ?
> > If it does, then it depends on it being exported, and it should also be
> > public.
> > If nobody uses it, then we can probably mark it deprecated for a while
> > and finally remove it down the road.
> No, Samba doesn't use it. It's only used in the file where it's
> declared, it could just be static.
Well breaking the ABI for free gain us nothing.
I would put a comment on the function, and try to remember to turn it
into a static the next time we make some big ABI change.
Maybe we can define a macro that will do that automatically ...
#if MAJORVER > X
So that it will be automatically made static the next time we change ver
even if we do not remember that, and then we can remove the if/endif
block the first time someone notices.
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>
More information about the samba-technical