Boost logo

Boost :

Subject: [boost] Boost C++ Library Patches (1.36.0) (from C++ Soup Blog)
From: Dean Michael Berris (dean_at_[hidden])
Date: 2008-11-03 08:36:17


Hi Guys,

I've recently posted some issues to the Boost Trac system. What
follows is the content of my post to my blog
(http://blog.cplusplus-soup.com/) regarding patches I've submitted.

I hope this helps!

---->8---

For those who have been having some trouble getting some libraries to
compile nicely in Boost 1.36 using GCC 4.3.2, I have posted some
issues (and associatively some patches) to Boost.Date_Time,
Boost.Asio, and Boost.System to the Boost Trac installation. I've
listed them down here with a short description of what the issue is
and what the solution is (and where you can get the patch for Boost
1.36.0).

GCC 4.3.2 and stricter identifier restrictions

In the past versions of GCC, the following code would pose no problems:

namespace ns {
    template <class T>
    struct name {
    };

    name<int> name; // error here!
}

Now however, you'll get an error saying "declaration of 'name' changes
the meaning of identifier 'name'". Apparently the fix is trivial which
is to give the namespace qualified name:

namespace ns {
    template <class T>
    struct name {
    };

    ns::name<int> name; // no error anymore
}

There is some code in Boost.Date_Time (release 1.36.0) which has this
problem. The issue is reported as Boost Trac issue #2465.

GCC 4.3.2 and stricter member construction requirements

Apparently GCC 4.3.2 has a more strict requirement on when a
particular member variable is actually initialized or not --
especially when they are used as temporaries in a static function. I'm
not sure if this is a compiler bug/feature, but nonetheless
Boost.Date_Time's contrained_value template does not explicitly
initialize the member 'value_' variable.

The trivial fix (which is to default-construct the member variable in
the constructor) is available attached to issue #2463.

Boost.System's Missing 'get_posix_category'

In Boost 1.36.0, Boost.System's get_posix_category function had been
removed. For strict backwards compatibility, it has to be put in to
let older versions of libraries that use the function to link
properly. This has been submitted as issue (with patches attached)
#2461.

Boost.Asio's 'pipe_select_interrupter' warning

Still with GCC 4.3.2, discarded return values turn out to be warned
against. There is a function in Boost.Asio's detail implementations
that calls '::write(...)' and then ignores the return value -- which
throws a warning and causes builds with -Werror to fail. The trivial
patch is attached to the submitted issue #2462.

Caveats

These patches are submitted to the Boost community through the Trac
Issue Trackings system. They have not yet been accepted by
authors/maintainers at the time of this writing. Like the saying goes,
use at your own risk.

Just as a reminder, these patches are to be applied to the Boost
1.36.0 release -- Boost 1.37.0 may have some of these issues
addressed. If you find have questions about the patches (and don't
want to post comments to the blog entry) please contact me directly
through dean.berris_at_cplusplus-soup.com.

--
Posted By Dean Michael to C++ Soup! at 11/03/2008 05:27:00 AM
---->8---
-- 
Dean Michael C. Berris
Software Engineer, Friendster, Inc.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk