Boost logo

Boost-Build :

Subject: Re: [Boost-build] [requires] cxx11_variadic_macros
From: Jürgen Hunold (jhunold_at_[hidden])
Date: 2015-10-15 01:37:22


Am Mittwoch, 14. Oktober 2015, 21:02:45 schrieb Raffi Enficiaud:
> Le 14/10/15 07:12, Jürgen Hunold a écrit :
> > Hi Raffi,
> >
> > Am Dienstag, 13. Oktober 2015, 19:45:05 schrieb Edward Diener:
> >> On 10/13/2015 11:41 AM, Raffi Enficiaud wrote:
> >>> Hi all,
> >>>
> >>> I have the following requirement on my bjam:
> >>>
> >>> requirements_boost_test = [ requires cxx11_variadic_macros ] ;
> >
> > On which Jamfile? Can you either attach a small testcase or point us to
> > the
> > feature branch containing the original Jamfile?
>
> It's in the branch topic/dataset-API-improvement, the
> test/build/Jamfile.v2 . I was just playing around with this, and so far
> I do not know how to check for variadic macro support. I was relying on
> this:
>
> #if !BOOST_PP_VARIADICS || ((__cplusplus >= 201103L) &&
> defined(BOOST_NO_CXX11_VARIADIC_MACROS))
>
> #define BOOST_TEST_NO_VARIADIC
> #endif
>
> which relies on what BOOST_PP_VARIADICS says for C++03. I do want this
> check only for the tests though, but also extend the range of BOOST_TEST
> support if I can safely enforce BOOST_PP_VARIADICS=1.

Can you try the Boost.Config tests in libs/config/checks ? Especially

libs/config/checks/test/boost_no_variadic_macros.ipp

does not use Boost.PP

The test are explicit, you have to run (in libs/config/checks)

 b2 cxx11_variadic_macros -a gcc-4.2~arm
 b2 cxx11_variadic_macros -a clang

My arm cross-compiler fails, clang in c++11 mode succeeds.

> Compiling a simple example using variadic macros using C++03 dialect
> works (for this compiler). So the "cxx11_variadic_macros : yes" is kind
> of correct, even if we are not in the C++11 dialect (?).

That might be the case. Use the clang docs or search for it. There should be
something on the net...

> > C++11 variadic macros should not be enabled with "-std=c++03". The
> > question is if the detection report "true" if only C99 variadic macros
> > are available.
> That is the funny thing. Should this say no to any cxx11_XXXX feature
> compiled in C++03?

Some compilers (I think gcc, too) default to C99 in c++03 mode. And clang is
most possibly mimicking this...

Hope this helps,

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold  ! 
* voice: ++49 4257 300       ! Fährstraße 1
* fax  : ++49 4257 300       ! 31609 Balge/Sebbenhausen
* jhunold_at_gmx.eu             ! Germany

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk