mpllibs icon indicating copy to clipboard operation
mpllibs copied to clipboard

MPLLIBS_LIMIT_STRING_SIZE cannot exceed 256

Open reuk opened this issue 8 years ago • 1 comments

The following gives build errors on apple llvm 7.1.

#define MPLLIBS_LIMIT_STRING_SIZE 257
#include <mpllibs/metaparse/string.hpp>
using my_string = MPLLIBS_STRING(R"(hello world)");

The errors:

/Users/reuben/dev/genrile/tests/evil.cpp:3:19: error: use of undeclared identifier 'MPLLIBS_V2_STRING_N'
using my_string = MPLLIBS_STRING(R"(hello world)");
                  ^
/usr/local/include/mpllibs/metaparse/string.hpp:15:24: note: expanded from macro 'MPLLIBS_STRING'
#define MPLLIBS_STRING MPLLIBS_V2_STRING
                       ^
/usr/local/include/mpllibs/metaparse/v2/string.hpp:380:52: note: expanded from macro 'MPLLIBS_V2_STRING'
          BOOST_PP_ENUM(MPLLIBS_LIMIT_STRING_SIZE, MPLLIBS_V2_STRING_N, s) \
                                                   ^
/Users/reuben/dev/genrile/tests/evil.cpp:3:19: error: use of undeclared identifier 'BOOST_PP_ENUM_M_1'
/usr/local/include/mpllibs/metaparse/string.hpp:15:24: note: expanded from macro 'MPLLIBS_STRING'
#define MPLLIBS_STRING MPLLIBS_V2_STRING
                       ^
/usr/local/include/mpllibs/metaparse/v2/string.hpp:380:11: note: expanded from macro 'MPLLIBS_V2_STRING'
          BOOST_PP_ENUM(MPLLIBS_LIMIT_STRING_SIZE, MPLLIBS_V2_STRING_N, s) \
          ^
/usr/local/include/boost/preprocessor/repetition/enum.hpp:32:24: note: expanded from macro 'BOOST_PP_ENUM'
# define BOOST_PP_ENUM BOOST_PP_CAT(BOOST_PP_ENUM_, BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4))
                       ^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/usr/local/include/boost/preprocessor/cat.hpp:29:34: note: expanded from macro 'BOOST_PP_CAT_I'
#    define BOOST_PP_CAT_I(a, b) a ## b
                                 ^
<scratch space>:138:1: note: expanded from here
BOOST_PP_ENUM_1
^
/usr/local/include/boost/preprocessor/repetition/enum.hpp:35:59: note: expanded from macro 'BOOST_PP_ENUM_1'
#    define BOOST_PP_ENUM_1(c, m, d) BOOST_PP_REPEAT_1(c, BOOST_PP_ENUM_M_1, (m, d))
                                                          ^
/Users/reuben/dev/genrile/tests/evil.cpp:3:19: error: expected a type
/usr/local/include/mpllibs/metaparse/string.hpp:15:24: note: expanded from macro 'MPLLIBS_STRING'
#define MPLLIBS_STRING MPLLIBS_V2_STRING
                       ^
/usr/local/include/mpllibs/metaparse/v2/string.hpp:382:7: note: expanded from macro 'MPLLIBS_V2_STRING'
      > \
      ^
/Users/reuben/dev/genrile/tests/evil.cpp:3:19: error: expected a type
/usr/local/include/mpllibs/metaparse/string.hpp:15:24: note: expanded from macro 'MPLLIBS_STRING'
#define MPLLIBS_STRING MPLLIBS_V2_STRING
                       ^
/usr/local/include/mpllibs/metaparse/v2/string.hpp:383:5: note: expanded from macro 'MPLLIBS_V2_STRING'
    >::type
    ^
/Users/reuben/dev/genrile/tests/evil.cpp:3:19: error: expected ';' after alias declaration
/usr/local/include/mpllibs/metaparse/string.hpp:15:24: note: expanded from macro 'MPLLIBS_STRING'
#define MPLLIBS_STRING MPLLIBS_V2_STRING
                       ^
/usr/local/include/mpllibs/metaparse/v2/string.hpp:383:6: note: expanded from macro 'MPLLIBS_V2_STRING'
    >::type
     ^

reuk avatar Mar 28 '16 19:03 reuk

Hi,

I'm aware of this limitation and I'm planning to provide a higher limit after the Boost 1.61 release (the first one containing Metaparse).

sabel83 avatar Mar 29 '16 10:03 sabel83