Boost C++ Libraries: Ticket #3520: Syntax Error in boost/typeof/typeof.hpp https://svn.boost.org/trac10/ticket/3520 <p> Line 18 of boost/typeof/typeof.hpp is: </p> <p> # ifndef(BOOST_TYPEOF_EMULATION) </p> <p> I don't think the brackets around the macro are correct. This line is within an ifdef for the <span class="underline">COMO</span> macro: the header file has similar blocks for other compilers, which do not have the brackets on the similar ifndef lines. </p> <p> Note that unless you use the <span class="underline">COMO</span> compiler your (other) compiler (e.g. g++) might not warn about this syntax error, but code within conditionally included code must still be syntactically correct, even though it is not actually included in the Translation Unit. This issue was found with PRQA QAC++, which does report recoverable issues in non-included code. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3520 Trac 1.4.3 Steven Watanabe Wed, 14 Oct 2009 05:00:31 GMT <link>https://svn.boost.org/trac10/ticket/3520#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3520#comment:1</guid> <description> <p> The Boost.Typeof tests pass with como... </p> </description> <category>Ticket</category> </item> <item> <author>Jason Masters <jason_masters@…></author> <pubDate>Wed, 14 Oct 2009 08:36:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3520#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3520#comment:2</guid> <description> <p> Do the Boost.Typeof tests define both __COMO__ and __GNUG__ ? I have checked a testcase of the issue with the online Comeau test: </p> <pre class="wiki">#if defined(__COMO__) # ifdef __GNUG__ # ifndef(BOOST_TYPEOF_EMULATION) # define BOOST_TYPEOF_KEYWORD typeof # endif # endif #endif </pre><p> With no defines this compiles successfully. With command line options -D__COMO__ -D__GNUG__ we get: </p> <pre class="wiki">"ComeauTest.c", line 3: error: expected an identifier # ifndef(BOOST_TYPEOF_EMULATION) ^ 1 error detected in the compilation of "ComeauTest.c". </pre><p> Which is what I would expect. If just __COMO__ is defined then compilation is successful. Even if the como compiler does parse this code successfully it is still wrong - other compilers still have to parse the code in the non-included #ifdef sections. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Wed, 14 Oct 2009 16:06:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3520#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3520#comment:3</guid> <description> <p> I see. I ran the tests with msvc as the backend. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peder Holt</dc:creator> <pubDate>Mon, 30 Aug 2010 20:22:26 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/3520#comment:4 https://svn.boost.org/trac10/ticket/3520#comment:4 <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> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.41.0</span> → <span class="trac-field-new">Boost-1.45.0</span> </li> </ul> <p> This is now be fixed </p> Ticket