
Andreas Sæbjørnsen wrote:
The first '#elif' directive is registered as an 'evaluated_conditional_expression(...)', but the second '#elif' is never evaluated since the previous '#if' directive is true, and it is therefore not registered as either a 'skipped_token(...)' or an 'evaluated_conditional_expression(...)'. The way I expected it to work was to register it as a 'skipped_token(...)'. Do you have a suggestion to how I should otherwise be handling this? If not, could it be possible to add the non-evaluated '#elif' to the skipped token stream?
This is fixed now (Boost CVS::HEAD and Boost CVS::BOOST_RC_1_34). Thanks for reporting.
Thank you very much! I appreciate the fast fix.
The suggestion is for preprocessor generated tokens where the
'macro.get_position().get_file().size() == 0'. An example of this is in the following code
#ifdef SOME_MACRO //DO SOMETHING #endif
Since 'SOME_MACRO' is not defined the 'expanding_object_like_macro(TokenT const ¯o,....)' will be passed a TokentT& const& macro with no position object, so asking for the line or column number will give a hard to debug segmentation fault.
This one is really strange, because if SOME_MACRO is not defined then the expanding_object_like_macro() pp hook shouldn't be called for this macro. For this reason I'm not able to reproduce this issue here.
Nevertheless, I think it's a bug if 'macro.get_position ().get_file().size() == 0' in any case (any token should have some associated file/position it was encountered at). Could you please try to isolate this problem and send me a sample?
No problem. I will send it to you as soon as I have it. :)
A change I have done to Wave which I have not told you about earlier is to
change the behaviour of on_warning(...) in
'tboost/wave/util/cpp_iterator.hpp' to
continue if a #warning directive is found, and not treat it like an error. I
do not know
if the CVS-version still behaves in this way. I also added a preprocessing
hook
on_warning(..) for the warning directive as I need to extract it. What do
you think of this
change? (Code Below for on_warning. Changed 'preprocessing_hooks.hpp'
attached).
Thanks
Andreas
#if BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE != 0
///////////////////////////////////////////////////////////////////////////////
//
// on_warning(): handle #warning directives
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
inline void
pp_iterator_functor<ContextT>::on_warning(
typename parse_tree_type::const_iterator const &begin,
typename parse_tree_type::const_iterator const &end)
{
BOOST_ASSERT(ctx.get_if_block_status());
// preprocess the given sequence into the provided list
token_sequence_type expanded;
get_token_value
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users