Boost logo

Boost-Build :

Subject: Re: [Boost-build] [requires] cxx11_variadic_macros
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2015-10-15 17:35:41

Le 15/10/15 04:19, Edward Diener a écrit :
> On 10/14/2015 2:53 PM, Raffi Enficiaud wrote:
>> So you're saying that for clang, we should have BOOST_PP_VARIADICS=1.
>> Why isn't it the case then? Explicitly setting toolset=clang does not
>> help.
> This is my error. Originally clang by default did not have variadic
> macro support in Boost PP. Then because of programmer feedback I turned
> on variadic macro support by default for clang in Boost PP
> unconditionally. This however lead to a slew of clang warnings when
> clang was compiled in C/C++ mode less than C99 or C++11. So then I
> changed Boost PP so that clang, like gcc, only has variadic macro
> support by default when compiling in C99 or C++11 mode. I had forgot
> about that final change I made for clang when I responded to this message.
> You can force variadic macro support for a compiler in Boost PP by
> defining BOOST_PP_VARIADICS=1 before Boost PP headers are included, or
> you can make sure of variadic macro support by default for clang and gcc
> by compiling in C99 ( for C ) or C++11 ( for C++ ) mode.

Right now what I am doing is that I activate the variadic macro support
for clang and disable this specific warning.
However, I wanted to do the same for GCC, but somehow I am unable to
deactivate this specific warning:

This very simple test case:

#pragma GCC diagnostic ignored "-Wvariadic-macros"
#include <stdio.h>

#define BLABLA(...) printf(__VA_ARGS__)

int main()

shows a bunch of warnings with "-pedantic" (expected) but it looks to me
impossible to deactivate with the #pragma (while if I have this on the
command line: "-pedantic -Wno-variadic-macros", it just works).

This is a annoying indeed for the user to have so many warnings... but
this is with "-pedantic" so its up to the users (and also boost.test
code is not really targeted to be used in another library: the warnings
ends at the compilation of a test module and are not propagated to other

Also, without "-pedantic" and without the #pragma, I get not warning at
all on this simple case: the default for GCC is to accept that code
without complain.

I was not able to silence the warning on our unit tests, but it turned
out that the "-pedantic" is activated automatically by


To summarize:
- boost.test unittests are compiling with "-pedantic" which generates a
lot of warnings when BOOST_PP_VARIADICS=1 is enforced
- it looks impossible to remove the variadic macro warnings with
#pragmas for GCC, at least when using -pedantic.
- when I remove the -pedantic, I still have the warnings, I guess
because of "<warnings>all"
- when I add -Wno-variadic-macro to the configuration, the warnings are

So it looks more or less safe to enforce BOOST_PP_VARIADICS=1 in boost.test.

Thanks for your help,

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at