Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost BCP namespace renaming : dispelling the FUD ?
From: BernardH (gmane.comp.lib.boost.user_at_[hidden])
Date: 2011-07-19 19:37:22


Thank you very much for your answer (and of course, your work on BCP ! ).

John Maddock <boost.regex <at> virgin.net> writes:

>
> > When implementing a library, one might want to neither require nor prevent
> > the
> > library users to also use any version of Boost.
> >
[...]
> > However, I have been reading that Boost brings some symbols that cannot be
> > renamed because they are out of any namespace, with "C" linkage[*].
> >
> > This brings the following questions :
> >
> > 1) can a list all such names be found ?
>
> Well a quick grep for extern "C" would do it?
>

Well, my grep-foo only got me so far as to find the 53 files, but I believe 'd
have to parse those to get the names inside the multiline "{}".
Anyway, they all are only in a dozen libraries.

> > 2) To be *completely safe*, must I :
> > 2.1) only avoid using those symbols in my library
> > 2.2) avoid the boost libaries that provide such symbols
> > 2.3) avoid boost libraries that depend on such symbols (how am I to find
> > out
> > which ?)
> > 2.4) avoid boost libraries that depend on the boost libraries providing
> > such
> > symbols (easier to do than 2.3 with bcp, I believe).
> > 2.5) Despair ! (i.e. forgo boost usage under such constraints).
>
> No need to dispair at all
>
> I changed bcp a while back to rename extern "C" functions that begin with a
> "boost_" prefix, and nagged library authors that weren't already doing so to
> make any extern "C" functions they were declaring to conform to that
> convention.

Thank you very much for this work. It believe it is very important to overcome
the reluctance to use Boost when developping libraries.
The misconception that it cannot be safely done is still very widespread and
dispelling would deserve a clear statement that such usage is indeed supported.
It is unfortunately not obvious as one currently has to guess it from the BCP
documentation (and would-be users might not even realize that BCP is indeed the
tool fit for such a use case !).

>
> So unless there have been any regressions, it should just plain work.... but
> let me know if it doesn't!!
>

Thank you very much, I'll give it a try !

Best Regards,

Bernard


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net