Boost C++ Libraries: Ticket #9705: Boost spirit fails to build with -DBOOST_NO_INTRINSIC_WCHAR_T https://svn.boost.org/trac10/ticket/9705 <p> Attempting to compile a program for Android using Boost::Spirit runs into the following problem: </p> <p> Android compilation requires the -DBOOST_NO_INTRINSIC_WCHAR_T definition. This turns off BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) in boost/type_traits/is_integral.hpp </p> <p> This then causes to_utf8() called by info::info(utf8_string, wchar_t) in boost/spirit/home/support/info.hpp to fail, as it calls boost::detail::make_unsigned_imp&lt;wchar_t&gt; which does a static assertion that the template parameter type is_integral or is_enum in boost/type_traits/make_unsigned.hpp </p> <p> Note that in my parser I am not explicitly using wchar_t nor wstring - in fact I have no need of wchar/wstring support, with standard ASCII text being completely sufficient. (The string types I do explicitly use are std::string, character literals and boost::spirit::qi::ascii) </p> <p> Example of the issue in compiling the libs/spirit/example/qi/roman.cpp example: </p> <pre class="wiki"> $g++ --version g++ (GCC) 4.8.2 $g++ -isystem /home/morettr/Downloads/boost_1_55_0/ -o roman.o -c roman.cpp # No defines, no problems. $g++ -isystem /home/morettr/Downloads/boost_1_55_0/ -o roman.o -c roman.cpp -DBOOST_NO_INTRINSIC_WCHAR_T -DBOOST_NO_CWCHAR -DBOOST_NO_STD_WSTRING In file included from /home/morettr/Downloads/boost_1_55_0/boost/proto/traits.hpp:24:0, from /home/morettr/Downloads/boost_1_55_0/boost/proto/expr.hpp:27, from /home/morettr/Downloads/boost_1_55_0/boost/proto/core.hpp:17, from /home/morettr/Downloads/boost_1_55_0/boost/proto/proto.hpp:12, from /home/morettr/Downloads/boost_1_55_0/boost/spirit/home/support/meta_compiler.hpp:19, from /home/morettr/Downloads/boost_1_55_0/boost/spirit/home/qi/meta_compiler.hpp:14, from /home/morettr/Downloads/boost_1_55_0/boost/spirit/home/qi/action/action.hpp:14, from /home/morettr/Downloads/boost_1_55_0/boost/spirit/home/qi/action.hpp:14, from /home/morettr/Downloads/boost_1_55_0/boost/spirit/home/qi.hpp:14, from /home/morettr/Downloads/boost_1_55_0/boost/spirit/include/qi.hpp:16, from roman.cpp:18: /home/morettr/Downloads/boost_1_55_0/boost/type_traits/make_unsigned.hpp: In instantiation of ‘struct boost::detail::make_unsigned_imp&lt;wchar_t&gt;’: /home/morettr/Downloads/boost_1_55_0/boost/type_traits/make_unsigned.hpp:146:1: required from ‘struct boost::make_unsigned&lt;wchar_t&gt;’ /home/morettr/Downloads/boost_1_55_0/boost/spirit/home/support/utf8.hpp:35:52: required from ‘boost::spirit::utf8_string boost::spirit::to_utf8(Char) [with Char = wchar_t; boost::spirit::utf8_string = std::basic_string&lt;char&gt;]’ /home/morettr/Downloads/boost_1_55_0/boost/spirit/home/support/info.hpp:54:44: required from here /home/morettr/Downloads/boost_1_55_0/boost/type_traits/make_unsigned.hpp:38:4: error: invalid application of ‘sizeof’ to incomplete type ‘boost::STATIC_ASSERTION_FAILURE&lt;false&gt;’ BOOST_STATIC_ASSERT( ^ </pre><p> This was tested with 1.55.0, but as far as I can tell from looking at the code on <a class="missing wiki">GitHub</a>, the problem should still exist for the current development version. Also, it's not Android compiler specific - the example above was done with standard g++ on an x86 Linux box. </p> <p> Desired outcome: All standard boost::spirit examples (except those which explicitly use wstring/wchar_t types) should compile and run with the "-DBOOST_NO_INTRINSIC_WCHAR_T -DBOOST_NO_CWCHAR -DBOOST_NO_STD_WSTRING" flag suite turned on. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9705 Trac 1.4.3 Joel de Guzman Sun, 14 Mar 2021 19:51:30 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9705#comment:1 https://svn.boost.org/trac10/ticket/9705#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> request to support an ancient compilers workaround without a patch </p> Ticket