Boost C++ Libraries: Ticket #9295: PHOENIX_LIMIT macro clash: property_tree -- log/sink https://svn.boost.org/trac10/ticket/9295 <p> Components: </p> <ul><li>spirit </li><li>phoenix </li><li>log </li><li>property_tree </li></ul><p> The following does not compile using gcc 4.8.1 or 4.7.2 (linux) using default warning options: </p> <pre class="wiki">#include "boost/property_tree/json_parser.hpp" #include "boost/log/sinks.hpp" </pre><p> The reason is that there are two (different?) definitions picked up, from deep within the include graphs: </p> <pre class="wiki">boost/phoenix/core/limits.hpp:26 #define PHOENIX_LIMIT BOOST_PHOENIX_LIMIT boost/spirit/home/classic/attribute.hpp:30 #define PHOENIX_LIMIT 6 </pre><p> (Note to others: A workaround for cases where the two are not truly used together is to use a pimpl.) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9295 Trac 1.4.3 Andrey Semashev Wed, 23 Oct 2013 15:27:14 GMT owner, component changed; cc set https://svn.boost.org/trac10/ticket/9295#comment:1 https://svn.boost.org/trac10/ticket/9295#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">Andrey.Semashev@…</span> added </li> <li><strong>owner</strong> changed from <span class="trac-author">Andrey Semashev</span> to <span class="trac-author">Thomas Heller</span> </li> <li><strong>component</strong> <span class="trac-field-old">log</span> → <span class="trac-field-new">phoenix</span> </li> </ul> <p> I think this needs to be resolved by Boost.Phoenix v2/v3 and Boost.Spirit maintainers. I don't see what can be done on Boost.Log part. My (naive) suggestion is to define PHOENIX_LIMIT in boost/phoenix/core/limits.hpp conditionally, or drop it altogether in favor of BOOST_PHOENIX_LIMIT. </p> Ticket John Fletcher <J.P.Fletcher@…> Mon, 03 Feb 2014 19:56:30 GMT <link>https://svn.boost.org/trac10/ticket/9295#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9295#comment:2</guid> <description> <p> I don't see why boost phoenix should define PHOENIX_LIMIT at all for its own use. I will test out offline not defining it and see what if anything breaks and fix it. It could break old code from Phoenix V2 however and so a conditional may be better with a note that is not encouraged. </p> </description> <category>Ticket</category> </item> <item> <author>John Fletcher <J.P.Fletcher@…></author> <pubDate>Mon, 03 Feb 2014 19:57:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9295#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9295#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/9295#comment:2" title="Comment 2">John Fletcher &lt;J.P.Fletcher@…&gt;</a>: </p> <blockquote class="citation"> <p> I don't see why boost phoenix should define PHOENIX_LIMIT at all for its own use. I will test out offline not defining it and see what if anything breaks and fix it. It could break old code from Phoenix V2 however and so a conditional may be better with a note that is not encouraged. </p> </blockquote> <p> I meant that it is not encouraged. </p> </description> <category>Ticket</category> </item> <item> <author>John Fletcher <J.P.Fletcher@…></author> <pubDate>Mon, 03 Feb 2014 20:04:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9295#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9295#comment:4</guid> <description> <p> A conditional will not work for the case where the other header comes second. </p> </description> <category>Ticket</category> </item> <item> <author>John Fletcher <J.P.Fletcher@…></author> <pubDate>Mon, 03 Feb 2014 20:37:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9295#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9295#comment:5</guid> <description> <p> I have run the phoenix tests offlien without the definition of PHOENIX_LIMIT and nothing breaks. </p> </description> <category>Ticket</category> </item> <item> <author>John Fletcher <J.P.Fletcher@…></author> <pubDate>Mon, 03 Feb 2014 20:56:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9295#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9295#comment:6</guid> <description> <p> boost/sprit has this: </p> <pre class="wiki">boost/spirit/home/classic/attribute.hpp:29-31 #if !defined(PHOENIX_LIMIT) #define PHOENIX_LIMIT 6 #endif // !defined(PHOENIX_LIMIT) </pre><p> so I have put this conditional code into boost/phoenix : </p> <pre class="wiki">boost/phoenix/core/limits.hpp:30-32 #if !defined(PHOENIX_LIMIT) #define PHOENIX_LIMIT BOOST_PHOENIX_LIMIT #endif </pre><p> I will put that on test in develop. </p> </description> <category>Ticket</category> </item> </channel> </rss>