Boost C++ Libraries: Ticket #6838: Adding include file with force_include makes Wave fail to emit #line directive https://svn.boost.org/trac10/ticket/6838 <p> It can be demonstrated with the wave tool: </p> <p> Input files </p> <p> a.cpp: </p> <pre class="wiki">int main(void) return 0; </pre><p> force.h: </p> <pre class="wiki">int func(void); </pre><p> Command line: </p> <pre class="wiki">wave -F force.h a.cpp </pre><p> Output: </p> <pre class="wiki">#line 1 "/Users/bonnedr/code/boost-wave-test/force.h" int func(void); int main(void) { return 0; } </pre><p> Expected output: </p> <pre class="wiki">#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; } </pre><p> 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. </p> <p> Fix: </p> <pre class="wiki">-if (iter_ctx-&gt;emitted_lines+2 == act_pos.get_line()) { +if (iter_ctx-&gt;emitted_lines+2 == act_pos.get_line() &amp;&amp; act_pos.get_line() != 1) { </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6838 Trac 1.4.3 Hartmut Kaiser Wed, 23 May 2012 14:38:18 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6838#comment:1 https://svn.boost.org/trac10/ticket/6838#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/78554" title="Wave: Fixed #6838: Adding include file with force_include makes Wave ...">[78554]</a>) Wave: Fixed <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6838" title="#6838: Bugs: Adding include file with force_include makes Wave fail to emit #line ... (closed: fixed)">#6838</a>: Adding include file with force_include makes Wave fail to emit #line directive Added support for test of --forceinclude option to testwave executable, added test case verifying <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6838" title="#6838: Bugs: Adding include file with force_include makes Wave fail to emit #line ... (closed: fixed)">#6838</a> is fixed. </p> Ticket