Boost logo

Boost :

Subject: [boost] Boost and clang under Windows
From: Edward Diener (eldiener_at_[hidden])
Date: 2013-09-29 12:59:27


First off I am not of course proposing any changes to the upcoming
release build of Boost 1.55 for clang under Windows.

It turns out that clang under Windows, possibly to support the ability
to use Windows header file, becomes another compiler which defines
_MSC_VER. I believe the Intel compiler also does this but there may be
some others.

However clang is a much more strictly conforming to the C++ standard
compiler than VC++ and does not have VC++'s quirks. This presents a
problem in Boost.

The Boost header files have numerous places where testing the macro
_MSC_VER produces slightly different behavior based on the fact that the
code is being used by VC++ or a compiler with the same behavior as VC++.
But clang does not have the same behavior as VC++ despite defining
_MSC_VER.

Can I go ahead and change some of these situations as necessary to get
clang under Windows to work properly with Boost code ?

The usual change will be to test not only _MSC_VER but also that
__clang__ is not defined for keeping the current implementation which
assumes a VC++ compatible compiler with VC++ behavior. I am willing to
make those changes in 'trunk' and keep an eye out for any significant
failures in unit tests for our current regression tests.

I have already made a slight change to Boost PP config.hpp on 'trunk' so
that clang for Windows will pass the preprocessor tests. I am willing to
work on other changes but I do not want to go ahead and do so if the
maintainers of other libraries see any reasons for me not making the
changes on 'trunk'. Of course I will test any changes I make locally to
make sure they do not affect any other _MSC_VER defined compilers as
well as with VC++. But the changes themselves should be fairly simple,
just adding a check that __clang__ is not defined as part of the VC++
type behavior. Obviously something like the many tests for _MSC_VER in
order to specify #pragma once will not change but some other situations
will to exclude clang from the _MSC_VER functionality.


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