[Boost-bugs] [Boost C++ Libraries] #6838: Adding include file with force_include makes Wave fail to emit #line directive

Subject: [Boost-bugs] [Boost C++ Libraries] #6838: Adding include file with force_include makes Wave fail to emit #line directive
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-04-27 09:43:26


#6838: Adding include file with force_include makes Wave fail to emit #line
directive
------------------------------------------------------------+---------------
 Reporter: Rasmus Bonnedal <rasmus.bonnedal@…> | Owner: hkaiser
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: wave
  Version: Boost 1.49.0 | Severity: Problem
 Keywords: wave force_include forceinclude #line |
------------------------------------------------------------+---------------
 It can be demonstrated with the wave tool:

 Input files

 a.cpp:
 {{{
 int main(void) return 0;
 }}}

 force.h:
 {{{
 int func(void);
 }}}

 Command line:
 {{{
 wave -F force.h a.cpp
 }}}

 Output:
 {{{
 #line 1 "/Users/bonnedr/code/boost-wave-test/force.h"
 int func(void);

 int main(void) { return 0; }
 }}}

 Expected output:
 {{{
 #line 1 "/Users/bonnedr/code/boost-wave-test/force.h"
 int func(void);
 #line 1 "/Users/bonnedr/code/boost-wave-test/a.cpp"
 int main(void) { return 0; }
 }}}

 I have tried a fix by changing line 756 in wave/util/cpp_iterator.hpp like
 this. It solves the problem for me but I don't know Boost Wave enough to
 know if it doesn't introduce a bunch of other problems.

 Fix:
 {{{
 -if (iter_ctx->emitted_lines+2 == act_pos.get_line()) {
 +if (iter_ctx->emitted_lines+2 == act_pos.get_line() && act_pos.get_line()
 != 1) {
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6838>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC