Opened 7 years ago

Last modified 6 years ago

#11718 new Bugs

No debug output when karma.hpp is included before qi.hpp

Reported by: anonymous Owned by: Joel de Guzman
Milestone: To Be Determined Component: spirit
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

In case karma.hpp is included macro karma\nonterminal\debug_handler.hpp::BOOST_SPIRIT_DEBUG_NODE(...) is defined.

In case qi.hpp is included macro qi\nonterminal\debug_handler.hpp::BOOST_SPIRIT_DEBUG_NODE(...) is defined.

both macros are secured by !defined(BOOST_SPIRIT_DEBUG_NODE). Therefore macro is defined only once which is fine.

In case BOOST_SPIRIT_DEBUG is defined expectation is that both macro implementations define equal code. But this is not the case:

  • If karma.hpp is included before qi.hpp resulting code is: #define BOOST_SPIRIT_DEBUG_NODE(r) r.name(#r);
  • If qi.hpp is included before karma.hpp resulting code is: #define BOOST_SPIRIT_DEBUG_NODE(r) r.name(#r); debug(r)

Therefore debug output is only available when header files are included in the right order. A simple macro extension should solve the issue.

Attachments (1)

debug_handler.hpp.patch (708 bytes ) - added by anonymous 7 years ago.

Download all attachments as: .zip

Change History (2)

by anonymous, 7 years ago

Attachment: debug_handler.hpp.patch added

comment:1 by anonymous, 6 years ago

Boost 1.60 has this issue also.

Note: See TracTickets for help on using tickets.