Boost logo

Boost :

Subject: Re: [boost] Showstopper for Boost 1.56?
From: Edward Diener (eldiener_at_[hidden])
Date: 2014-08-03 18:53:43

On 8/3/2014 4:35 PM, Eric Niebler wrote:
> On 7/31/2014 5:03 PM, Edward Diener wrote:
>> On 7/31/2014 7:17 PM, Gavin Lambert wrote:
>>> On 1/08/2014 10:08, Niall Douglas wrote:
>>>> Ok, so solutions to stopping tens of megabytes of compiler warnings
>>>> spew for a build of Boost 1.56 on clang are as follows:
>>>> 1. Boost Build adds -Wno-c99-extensions and -Wno-variadic-macros to
>>>> all clang builds.
>>>> 2. All those libraries using -pedantic with Preprocessor (at least
>>>> Chrono, Thread and Test) wrap their use of Preprocessor with #pragmas
>>>> disabling the warnings.
>>>> 3. All those libraries using -pedantic with Preprocessor (at least
>>>> Chrono, Thread and Test) add -Wno-c99-extensions and
>>>> -Wno-variadic-macros to all clang builds.
>>> 4. Those libraries currently using -pedantic stop doing so, at least for
>>> clang builds.
>> In clang-linux.jam and clang-darwin.jam, the '-pedantic' option is
>> passed when <warnings>all is specified and not passed when <warnings>on
>> is specified. So what appears to be needed is either just changing the
>> line which specifies <warnings>all to be the same as <warnings>on in the
>> clang jam files, or keeping the clang jam file as is and changing the
>> particular libraries putting out the excessive messages to either
>> specify <warnings>on rather than <warnings>all for clang builds or add
>> the options specified in 3) above.
>> The problem with changing the jam files is that end-users will also get
>> the change where <warnings>all does not specify '-pedantic' where they
>> might really want it to.
> Since nobody has made a definite suggestion or submitted a patch, this
> issue will in all likelihood not be fixed for 1.56. Sorry, guys.

I am willing to patch Boost PP so that clang is treated like gcc, since
it is an easy patch. That is that clang will be tested for variadic
macro support as gcc has always been tested for variadic macro support.
The corresponding lines for clang, as it has always been for gcc, would
then be:

> # elif !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L
> # else

This of course needs to be tested by everybody in the 'master' test
matrix to make sure it does not break anyone's code. This is the main
reason I have been loth to do this at this late time before the Boost
1.56 release.

When the clang issue originally came up months ago a number of people
were upset that clang was set not to have variadic macro support in
Boost PP. There was originally specific code in the Boost PP for turning
off variadic macro support for clang unconditionally. So my reaction was
to turn it on unconditionally after finding out that clang has always
supported variadic macros from the beginning, and this satisfied those
working with clang and using variadic macros. Now with the issue of
warnings when '<warnings>all' is specifically used in jam files, we have
the situation we find ourselves in.

I do not feel empowered to make this call myself, since a change to the
guts of Boost PP config.h affects every library using Boost PP. But I am
confident it should work in theory. But if some library is using Boost
PP variadic macros and doesn't have the clang equivalent option set that
turns on C++0x or better support then that library will fail.

OTOH we could look for the libraries that have '<warnings>all' in their
jam files and create pull requests so that it gets changed to
<warning>on whenever clang is the compiler. Something like:

'<toolset>clang:<warnings>on' as a project requirement I suppose.

As far as end-user using Boost libraries, other than building them, with
clang they would only see the clang warnings if they specify '-pedantic'
and the library used variadic macros.

Boost list run by bdawes at, gregod at, cpdaniel at, john at