[config] gcc-4.8 and __GXX_EXPERIMENTAL_CXX0X__
Hi, it seems that gcc-4.8 doesn't defines any more __GXX_EXPERIMENTAL_CXX0X__ when the flag -std=c++11 is given. This means that all the BOOST_NO_CXX11_ are defined. Could something be done to make usable gcc-4.8 in c++11 mode? Best, Vicente
On 1 April 2013 15:17, Vicente J. Botet Escriba wrote:
Hi,
it seems that gcc-4.8 doesn't defines any more __GXX_EXPERIMENTAL_CXX0X__ when the flag -std=c++11 is given.
Are you sure? The standard library no longer checks it, using __cplusplus >= 201103L instead, but the compiler still defines the old macro. The old macro is still documented as being defined.
This means that all the BOOST_NO_CXX11_ are defined.
Could something be done to make usable gcc-4.8 in c++11 mode?
You could check the value of __cplusplus instead, because
__GXX_EXPERIMENTAL_CXX0X__ will stop being defined at some point
eventually.
A related topic I've been meaning to raise is that
Le 01/04/13 16:35, Jonathan Wakely a écrit :
On 1 April 2013 15:17, Vicente J. Botet Escriba wrote:
Hi,
it seems that gcc-4.8 doesn't defines any more __GXX_EXPERIMENTAL_CXX0X__ when the flag -std=c++11 is given. Are you sure? Maybe my installation is not correct, but with it __GXX_EXPERIMENTAL_CXX0X__ is not defined. Could some check it? BTW, there are some pages pointing to this problem on the net. The standard library no longer checks it, using __cplusplus >= 201103L instead, but the compiler still defines the old macro. The old macro is still documented as being defined. Maybe there is a bug on gcc-4.8 ;-)
This means that all the BOOST_NO_CXX11_ are defined.
Could something be done to make usable gcc-4.8 in c++11 mode? You could check the value of __cplusplus instead, because __GXX_EXPERIMENTAL_CXX0X__ will stop being defined at some point eventually. I'm not using it directly, but via boost/config.hpp
A related topic I've been meaning to raise is that
unconditionally defines: // C++0x headers not yet (fully!) implemented // # define BOOST_NO_CXX11_HDR_THREAD
This is incorrect. Depending on how GCC was configured libstdc++ has provided a complete <thread> since at least version 4.4, and for GCC 4.8 it unconditionally provides a complete <thread>.
This should be correct:
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) # define BOOST_NO_CXX11_HDR_THREAD #elif (__GNUC__ == 4 && __GNUC_MINOR__ < 8) # if !(defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) && defined(_GLIBCXX_USE_SCHED_YIELD) && defined(_GLIBCXX_USE_NANOSLEEP) && defined(__GXX_EXPERIMENTAL_CXX0X__)) # define BOOST_NO_CXX11_HDR_THREAD #elif __cplusplus < 201103L # define BOOST_NO_CXX11_HDR_THREAD #endif
I don't know if some documentation needs to be updated, but if you have check it, could you to commit it? Best, Vicente
On 1 April 2013 15:58, Vicente J. Botet Escriba wrote:
Le 01/04/13 16:35, Jonathan Wakely a écrit :
On 1 April 2013 15:17, Vicente J. Botet Escriba wrote:
Hi,
it seems that gcc-4.8 doesn't defines any more __GXX_EXPERIMENTAL_CXX0X__ when the flag -std=c++11 is given.
Are you sure?
Maybe my installation is not correct, but with it __GXX_EXPERIMENTAL_CXX0X__ is not defined. Could some check it?
I see it still defined with GCC 4.8 or 4.9
BTW, there are some pages pointing to this problem on the net.
The standard library no longer checks it, using __cplusplus >= 201103L instead, but the compiler still defines the old macro. The old macro is still documented as being defined.
Maybe there is a bug on gcc-4.8 ;-)
This means that all the BOOST_NO_CXX11_ are defined.
Could something be done to make usable gcc-4.8 in c++11 mode?
You could check the value of __cplusplus instead, because __GXX_EXPERIMENTAL_CXX0X__ will stop being defined at some point eventually.
I'm not using it directly, but via boost/config.hpp
A related topic I've been meaning to raise is that
unconditionally defines: // C++0x headers not yet (fully!) implemented // # define BOOST_NO_CXX11_HDR_THREAD
This is incorrect. Depending on how GCC was configured libstdc++ has provided a complete <thread> since at least version 4.4, and for GCC 4.8 it unconditionally provides a complete <thread>.
This should be correct:
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) # define BOOST_NO_CXX11_HDR_THREAD #elif (__GNUC__ == 4 && __GNUC_MINOR__ < 8) # if !(defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) && defined(_GLIBCXX_USE_SCHED_YIELD) && defined(_GLIBCXX_USE_NANOSLEEP) && defined(__GXX_EXPERIMENTAL_CXX0X__)) # define BOOST_NO_CXX11_HDR_THREAD #elif __cplusplus < 201103L # define BOOST_NO_CXX11_HDR_THREAD #endif
I don't know if some documentation needs to be updated, but if you have check it, could you to commit it?
I haven't checked it, and I don't have commit rights. I'll run the tests and report back ...
Le 01/04/13 17:12, Jonathan Wakely a écrit :
On 1 April 2013 15:58, Vicente J. Botet Escriba wrote:
Le 01/04/13 16:35, Jonathan Wakely a écrit :
On 1 April 2013 15:17, Vicente J. Botet Escriba wrote:
Hi,
it seems that gcc-4.8 doesn't defines any more __GXX_EXPERIMENTAL_CXX0X__ when the flag -std=c++11 is given. Are you sure? Maybe my installation is not correct, but with it __GXX_EXPERIMENTAL_CXX0X__ is not defined. Could some check it? I see it still defined with GCC 4.8 or 4.9
Forget this post. I was calling to bjam as follows bjam toolset=gcc-4.8x but in my user-config file I configured using darwin : 4.8.0x : /usr/gcc-4.8/bin/g++-4.8 : <lnkflags>-lssp <cxxflags>-fstack-protector-all <cxxflags>-std="c++11" ; Unfortunately bjam toke the default gcc which doesn't runs in c++11 mode without any explicit ERROR :( using darwin ; Best, Vicente
participants (2)
-
Jonathan Wakely
-
Vicente J. Botet Escriba