[boost] [smart_ptr][thread] Build failures

2 views
Skip to first unread message

Raffi Enficiaud via Boost

unread,
Mar 1, 2017, 4:03:00 AM3/1/17
to bo...@lists.boost.org, Raffi Enficiaud
Hi all,

I have the following compilation issues on master and develop, failing
the VS2008, VS2012, VS2013 builds for boost.test (VS2015 ok):


01-Mar-2017 09:57:43 common.mkdir ..\..\..\bin.v2\libs\thread
01-Mar-2017 09:57:43 common.mkdir ..\..\..\bin.v2\libs\thread\build
01-Mar-2017 09:57:43 common.mkdir ..\..\..\bin.v2\libs\thread\build\msvc-11
01-Mar-2017 09:57:43 common.mkdir
..\..\..\bin.v2\libs\thread\build\msvc-11\debug
01-Mar-2017 09:57:43 common.mkdir
..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static
01-Mar-2017 09:57:43 common.mkdir
..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static\threading-multi
01-Mar-2017 09:57:43 common.mkdir
..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static\threading-multi\win32
01-Mar-2017 09:57:45 compile-c-c++
..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static\threading-multi\win32\thread.obj
01-Mar-2017 09:57:45 thread.cpp
01-Mar-2017 09:57:45
D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/thread/detail/thread.hpp(486)
: warning C4067: unexpected tokens following preprocessor directive -
expected a newline
01-Mar-2017 09:57:45
D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(355)
: error C2059: syntax error : ')'
01-Mar-2017 09:57:45
D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(358)
: see reference to class template instantiation
'boost::detail::sp_less_align<T,U>' being compiled
01-Mar-2017 09:57:45
D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
: error C2143: syntax error : missing ')' before ';'
01-Mar-2017 09:57:45
D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
: error C2143: syntax error : missing '}' before ')'
01-Mar-2017 09:57:45
D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
: error C2059: syntax error : ')'
01-Mar-2017 09:57:45
D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
: error C2238: unexpected token(s) preceding ';'


Can those be quickly fixed?
Thanks,
Raffi


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Andrey Semashev via Boost

unread,
Mar 1, 2017, 4:34:00 AM3/1/17
to bo...@lists.boost.org, Andrey Semashev
On 03/01/17 12:02, Raffi Enficiaud via Boost wrote:
> Hi all,
>
> I have the following compilation issues on master and develop, failing
> the VS2008, VS2012, VS2013 builds for boost.test (VS2015 ok):
>
>
> 01-Mar-2017 09:57:43 common.mkdir ..\..\..\bin.v2\libs\thread
> 01-Mar-2017 09:57:43 common.mkdir ..\..\..\bin.v2\libs\thread\build
> 01-Mar-2017 09:57:43 common.mkdir
> ..\..\..\bin.v2\libs\thread\build\msvc-11
> 01-Mar-2017 09:57:43 common.mkdir
> ..\..\..\bin.v2\libs\thread\build\msvc-11\debug
> 01-Mar-2017 09:57:43 common.mkdir
> ..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static
> 01-Mar-2017 09:57:43 common.mkdir
> ..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static\threading-multi
> 01-Mar-2017 09:57:43 common.mkdir
> ..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static\threading-multi\win32
>
> 01-Mar-2017 09:57:45 compile-c-c++
> ..\..\..\bin.v2\libs\thread\build\msvc-11\debug\link-static\threading-multi\win32\thread.obj
>
> 01-Mar-2017 09:57:45 thread.cpp
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/thread/detail/thread.hpp(486)
> : warning C4067: unexpected tokens following preprocessor directive -
> expected a newline

Looks like the compiler doesn't recognize alternative spelling of
boolean operators (`and` in this case), which should be keywords. The
workaround is simple: replace it with the primary spelling `&&`.

> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(355)
> : error C2059: syntax error : ')'
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(358)
> : see reference to class template instantiation
> 'boost::detail::sp_less_align<T,U>' being compiled
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
> : error C2143: syntax error : missing ')' before ';'
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
> : error C2143: syntax error : missing '}' before ')'
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
> : error C2059: syntax error : ')'
> 01-Mar-2017 09:57:45
> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(357)
> : error C2238: unexpected token(s) preceding ';'

This code looks correct to me. I can only guess what the compiler is
complaining about. Maybe it thinks the operator `<` is an opening angle
brace for template parameters. Can you try wrapping
`boost::alignment_of<T>::value` and `boost::alignment_of<U>::value` in
parenthesis?

In any case, I think both these issues should be reported to MS Connect.

Peter Dimov via Boost

unread,
Mar 1, 2017, 4:53:39 AM3/1/17
to bo...@lists.boost.org, Peter Dimov
Andrey Semashev wrote:
> > D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(355)
> > : error C2059: syntax error : ')'

> This code looks correct to me. I can only guess what the compiler is
> complaining about. Maybe it thinks the operator `<` is an opening angle
> brace for template parameters.

That's it. This is the minimal test:

template<class T> struct value
{
};

#include <boost/make_shared.hpp>

int main()
{
}

MSVC is fun.

Peter Dimov via Boost

unread,
Mar 1, 2017, 5:09:36 AM3/1/17
to bo...@lists.boost.org, Peter Dimov
Raffi Enficiaud wrote:

> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(355)
> : error C2059: syntax error : ')'

This should be fixed now.

Raffi Enficiaud via Boost

unread,
Mar 1, 2017, 8:01:44 AM3/1/17
to bo...@lists.boost.org, Raffi Enficiaud
Le 01/03/2017 à 11:09, Peter Dimov via Boost a écrit :
> Raffi Enficiaud wrote:
>
>> D:\bamboo_build_dir\SW-BCB108-VC2012W64\library\boost/smart_ptr/allocate_shared_array.hpp(355)
>> : error C2059: syntax error : ')'
>
> This should be fixed now.

works! Thanks for the light speed fix!

Raffi
Reply all
Reply to author
Forward
0 new messages