"invalid token pasting" macro bug
When I use Spirit with CodeWarrior 9 (just released), I get a bunch of warnings as shown below. The CodeWarrior release notes explain that "According to the language standard, the '##' token pasting operator can only generate other tokens. This warning indicates when a paste was found that did not result in a token. The code will still compile as it did previously, but it may be a useful hint if the compiler emits an error later on." Warning : invalid token pasting of 'BOOST_PP_LIST_FIRST_I' and '(' (included from: expanding macro 'BOOST_PP_LIST_FIRST' expanding macro 'BOOST_PP_LIST_FOR_EACH_I_M_D' expanding macro 'BOOST_PP_LIST_FOR_EACH_I_M' expanding macro 'BOOST_PP_FOR_1_C' expanding macro 'BOOST_PP_FOR_1' expanding macro 'BOOST_PP_LIST_FOR_EACH_I' type_traits.hpp:58 composite.ipp:16 composite.hpp:15 directives.hpp:27 numerics.hpp:19 core.hpp:34 spirit.hpp:30 ParseCalcLine.cp:5) type_with_alignment.hpp line 55 on_ptr, BOOST_PP_NIL)))))))))))) -- http://www.jwwalker.com/
James W. Walker wrote:
When I use Spirit with CodeWarrior 9 (just released), I get a bunch of warnings as shown below. The CodeWarrior release notes explain that "According to the language standard, the '##' token pasting operator can only generate other tokens. This warning indicates when a paste was found that did not result in a token. The code will still compile as it did previously, but it may be a useful hint if the compiler emits an error later on."
Warning : invalid token pasting of 'BOOST_PP_LIST_FIRST_I' and '(' (included from: expanding macro 'BOOST_PP_LIST_FIRST' expanding macro 'BOOST_PP_LIST_FOR_EACH_I_M_D' expanding macro 'BOOST_PP_LIST_FOR_EACH_I_M' expanding macro 'BOOST_PP_FOR_1_C' expanding macro 'BOOST_PP_FOR_1' expanding macro 'BOOST_PP_LIST_FOR_EACH_I' type_traits.hpp:58 composite.ipp:16 composite.hpp:15 directives.hpp:27 numerics.hpp:19 core.hpp:34 spirit.hpp:30 ParseCalcLine.cp:5) type_with_alignment.hpp line 55 on_ptr, BOOST_PP_NIL))))))))))))
Try this: #define BOOST_PP_CONFIG_FLAGS() BOOST_PP_CONFIG_STRICT() (All of those warnings come from workarounds used for previous versions of Metrowerks.) Regards, Paul Mensonides
--- In Boost-Users@yahoogroups.com, "Paul Mensonides"
Try this:
#define BOOST_PP_CONFIG_FLAGS() BOOST_PP_CONFIG_STRICT()
(All of those warnings come from workarounds used for previous versions of Metrowerks.)
OK, I tried that, and it went from 14 warnings down to 1: Warning : invalid token pasting of 'BOOST_MPL_PP_TUPLE_11_ELEM_5' and '(' (included from: expanding macro 'BOOST_PP_CAT' expanding macro 'BOOST_MPL_PP_SUB_DELAY' expanding macro 'BOOST_MPL_PP_SUB' expanding macro 'BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL' expanding macro 'BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL' expanding macro 'BOOST_MPL_AUX_VOID_SPEC_MAIN' expanding macro 'BOOST_MPL_AUX_VOID_SPEC' apply_if.hpp:20 basics.hpp:19 core.hpp:28 spirit.hpp:30 ParseCalcLine.cp:8) if.hpp line 172 ELEM_5, (0,0,0,0,1,2,3,4,5,6,7))
jwwalker_com wrote:
--- In Boost-Users@yahoogroups.com, "Paul Mensonides"
wrote: Try this:
#define BOOST_PP_CONFIG_FLAGS() BOOST_PP_CONFIG_STRICT()
(All of those warnings come from workarounds used for previous versions of Metrowerks.)
OK, I tried that, and it went from 14 warnings down to 1:
Warning : invalid token pasting of 'BOOST_MPL_PP_TUPLE_11_ELEM_5' and '(' (included from: expanding macro 'BOOST_PP_CAT' expanding macro 'BOOST_MPL_PP_SUB_DELAY' expanding macro 'BOOST_MPL_PP_SUB' expanding macro 'BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL' expanding macro 'BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL' expanding macro 'BOOST_MPL_AUX_VOID_SPEC_MAIN' expanding macro 'BOOST_MPL_AUX_VOID_SPEC' apply_if.hpp:20 basics.hpp:19 core.hpp:28 spirit.hpp:30 ParseCalcLine.cp:8) if.hpp line 172 ELEM_5, (0,0,0,0,1,2,3,4,5,6,7))
Unfortunately, to get rid of this one, you will need to modify your copy of "boost/mpl/aux_/config/preprocessor.hpp" header: #if defined(__MWERKS__) && (__MWERKS__ <= 0x3003 || !defined(BOOST_STRICT_CONFIG)) \ line needs to become #if defined(__MWERKS__) && __MWERKS__ <= 0x3003 \ I just fixed it in the CVS, so at least the change will go into the next release. HTH, Aleksey
participants (4)
-
Aleksey Gurtovoy
-
James W. Walker
-
jwwalker_com
-
Paul Mensonides