[C++-sig] Re: Boost.Python in SUSE 9.0 or SUSE 9.1?

Chris Hoeppler hoeppler at diener.iap.physik.uni-tuebingen.de
Tue Jul 6 22:03:30 CEST 2004


On Tue, 6 Jul 2004, David Abrahams wrote:

> Chris Hoeppler <hoeppler at diener.iap.physik.uni-tuebingen.de> writes:
>
> > On Tue, 29 Jun 2004, Ralf W. Grosse-Kunstleve wrote:
> >
> >> --- David Abrahams <dave at boost-consulting.com> wrote:
> >> > Chris Hoeppler <hoeppler at diener.iap.physik.uni-tuebingen.de> writes:
> >> >
> >> > > FWIW, the compiler is happy with  "catch(exception_cref &e)", though I do
> >> > > --------------------------------------------------------^
> >> > > not know whether it would be okay to make that change...
> >> >
> >> > Sure; you can do that in your local copy.
> >>
> >> David is telling me:
> >>
> >> > > Hi David, I think he was asking if we can make that change in the main
> >> version
> >> .
> >> > > I think we should unless you have objections. I can run tests on all our
> >> > > platforms to make sure it works everywhere. Please let me know.
> >>
> >> > Yes, I have objections, at least if you don't make the patch very
> >> > precise and conditional.  It will break on many compilers.  The
> >> > add_reference invocation above it should have already added a
> >> > reference and many compilers (even most GCCs?) will choke on adding a
> >> > reference to a type that is already a reference.
> >>
> >> I.e. what we need is a very specific set of #ifdef's that will apply your patch
> >> only under SUSE 9, and only if the compiler with SUSE's patches is used.
> >
> > Hi Ralf,
> >
> > thanks for the pointers. Unfortunately I was unable to find a macro which
> > would allow to decide whether the gcc-version used was patched by SuSE. So
> > I guess, that for the time being I have to (a) install an 'official' gcc
> > release or (b) apply my patch locally. BTW, a first try with gcc-3.3.4 and
> > gcc-3.4.0 seemes to indicate that neither minds the added reference.
> > Should they?
>
> Not neccessarily.  There's been a DR which says they are legal.
> Some earlier GCCs will barf.  If you can satisfy yourself that you're
> not going to cause trouble, I'll be happy to accept the patch.

Unfortunately I cannot as you were right in your first post forwarded by
Ralf: GCC considers forming a reference to the reference type `const
error&' an error. My impression that the change was okay was based on the
fact that just compiling the header was possible with the additional
reference. However, trying to instantiate the template, as happens when
libs/python/test/exception_translator is built, results in errors as
follows:

<snip>
../../../libs/python/test/exception_translator.cpp:21:   instantiated from
here
/usr/local/src/boost_1_31_0/boost/python/detail/translate_exception.hpp:38:
error: forming reference to reference type `const error&'
<snip>

I just checked this for gcc-3.3.4 and gcc-3.4.0 (official), and
gcc-3.3.1 (as shipped by SuSE 8.2) So it will have to be non-SuSE gcc's
for the time being...

Sorry for the noise and thanks for the help,
Chris.




More information about the Cplusplus-sig mailing list