Boost C++ Libraries: Ticket #6139: error: "BOOST_CLANG" is not defined https://svn.boost.org/trac10/ticket/6139 <pre class="wiki">boost/detail/container_fwd.hpp:72:9: error: "BOOST_CLANG" is not defined </pre><p> This header file at line 72 contains the following: </p> <pre class="wiki">#if BOOST_CLANG </pre><p> But BOOST_CLANG is not even defined in my environment (gcc 4.1.2 on RHEL 5.x). I've checked all other occurrences of BOOST_CLANG in boost header files and all contain construct such as </p> <pre class="wiki">defined(BOOST_CLANG) </pre><p> The problem is present in boost 1.48.0 as well. I changed line 72 to: </p> <pre class="wiki">#if defined(BOOST_CLANG) &amp;&amp; (BOOST_CLANG) </pre><p> and it seems to work now. </p> <p> Perhaps it could be changed just to: </p> <pre class="wiki">#if defined(BOOST_CLANG) </pre><p> Should you need more information, just ping me. </p> <p> Ivo Raisr </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6139 Trac 1.4.3 Daniel James Fri, 18 Nov 2011 11:32:46 GMT <link>https://svn.boost.org/trac10/ticket/6139#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6139#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/75544" title="Detail: Revert [67484] in container_fwd. Refs #6139">[75544]</a>) Detail: Revert <a class="changeset" href="https://svn.boost.org/trac10/changeset/67484" title="Added the get_c_string function back in (it dispatches to the ...">[67484]</a> in container_fwd. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6139" title="#6139: Bugs: error: &#34;BOOST_CLANG&#34; is not defined (closed: fixed)">#6139</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Fri, 18 Nov 2011 11:35:38 GMT</pubDate> <title>owner, status, component changed https://svn.boost.org/trac10/ticket/6139#comment:2 https://svn.boost.org/trac10/ticket/6139#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">nasonov</span> to <span class="trac-author">Daniel James</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>component</strong> <span class="trac-field-old">any</span> → <span class="trac-field-new">None</span> </li> </ul> <p> Sorry I'd meant to revert that change before, but forgot to. </p> Ticket Jürgen Hunold Sat, 19 Nov 2011 14:35:28 GMT attachment set https://svn.boost.org/trac10/ticket/6139 https://svn.boost.org/trac10/ticket/6139 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">container_fwd_guarded.diff</span> </li> </ul> Ticket Jürgen Hunold Sat, 19 Nov 2011 14:35:56 GMT attachment set https://svn.boost.org/trac10/ticket/6139 https://svn.boost.org/trac10/ticket/6139 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">container_fwd_simple.diff</span> </li> </ul> Ticket Jürgen Hunold Sat, 19 Nov 2011 14:42:38 GMT <link>https://svn.boost.org/trac10/ticket/6139#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6139#comment:3</guid> <description> <p> Revision <a class="ext-link" href="https://svn.boost.org/trac/boost/changeset/75544"><span class="icon">​</span>https://svn.boost.org/trac/boost/changeset/75544</a> just broke my clang builds. The correct solution would be to either </p> <ul><li>use #if defined(BOOST_CLANG) see container_fwd_guarded.diff </li><li>change "class" to struct see containner_fwd_simple.diff </li></ul><p> The interesting thing is that container_fwd.hpp contains a msvc-suppression for struct/class mismatch: line 104ff: </p> <pre class="wiki">#if defined(BOOST_MSVC) #pragma warning(push) #pragma warning(disable:4099) // struct/class mismatch in fwd declarations #endif </pre><p> So the "correct" solution depends on how the corresponding standard library declares struct or class "complex". At least the guarded approach prevents clang from emitting a warning. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 19 Nov 2011 16:17:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6139#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6139#comment:4</guid> <description> <p> Detecting clang is not the right thing to do, it should be based on the standard library not the compiler. How did it break your build? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jürgen Hunold</dc:creator> <pubDate>Sat, 19 Nov 2011 20:53:26 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6139#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6139#comment:5</guid> <description> <p> clang issues a "-Wmismatched-tags" warning for struct/class mismatches. This is C4099 in msvc as mentioned before. </p> <p> To be compatible with the msvc-settings, we have -Werror=mismatched-tags to reduce the noise in our sources. </p> <p> The proper way seems to be do "struct complex;" for all and be happy. </p> <p> If all standard libraries do it that way, of course. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Sun, 20 Nov 2011 11:02:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6139#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6139#comment:6</guid> <description> <p> I tried to fix this in <a class="changeset" href="https://svn.boost.org/trac10/changeset/75561" title="Detail: `complex` is a struct in Dinkumware. IIRC it's `class` in ...">[75561]</a>, although I'm not sure if it will work as I don't have clang on windows. If it doesn't, can you build and run <code>config_info</code> (from <code>libs/config/test/config_info.cpp</code>) and attach the output. </p> <p> I might just change it to always disable forwarding for clang, clang parses the standard headers pretty quickly so it shouldn't make any real difference. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jürgen Hunold</dc:creator> <pubDate>Sun, 20 Nov 2011 15:19:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6139#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6139#comment:7</guid> <description> <p> Does not work. You should #define BOOST_CONTAINER_FWD_COMPLEX_STRUCT for #if defined(BOOST_CLANG). And this is on Linux, my settings are just for reducing cross-plattform compiler/stdlib inconsistencies. I think I'll #define BOOST_DETAIL_NO_CONTAINER_FWD in the meantime. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 20 Nov 2011 16:17:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6139#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6139#comment:8</guid> <description> <p> Sorry, I'm not going to do anything until I have a better idea of what your setup is. If you attach the output of <code>config_info.cpp</code> that would help. Or if that's too difficult, you could just tell me. </p> <p> It'd also help if you explained why you think that the definition of <code>complex</code> is determined by the compiler and not the standard library. I'm not making a change just because it happens to work on one particular setup without understanding the reason behind wanting that change. </p> <p> On my linux box clang uses gcc's standard library by default, and in that <code>complex</code> is defined as <code>class complex</code>. There must be some reason why it isn't on yours, but without more information I can only guess. At the moment, I don't know which standard library you're using or which version of clang you're using. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jürgen Hunold</dc:creator> <pubDate>Mon, 21 Nov 2011 15:28:55 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/6139 https://svn.boost.org/trac10/ticket/6139 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">clang_config.info</span> </li> </ul> <p> Output of config_info_threadedfor clang 3.1 </p> Ticket Jürgen Hunold Mon, 21 Nov 2011 15:36:14 GMT attachment set https://svn.boost.org/trac10/ticket/6139 https://svn.boost.org/trac10/ticket/6139 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">error.txt</span> </li> </ul> <p> clang error backtrace </p> Ticket Jürgen Hunold Mon, 21 Nov 2011 15:41:36 GMT <link>https://svn.boost.org/trac10/ticket/6139#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6139#comment:9</guid> <description> <p> Yes, makes sense. I've attached the output of config_info (threaded) and my full clang backtrace of the error. If you need more information or more tests, please ping me again. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Mon, 21 Nov 2011 23:21:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6139#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6139#comment:10</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/75600" title="Detail: Fix `BOOST_CONTAINER_FWD_COMPLEX_STRUCT`. Refs #6139. My last ...">[75600]</a>) Detail: Fix <code>BOOST_CONTAINER_FWD_COMPLEX_STRUCT</code>. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6139" title="#6139: Bugs: error: &#34;BOOST_CLANG&#34; is not defined (closed: fixed)">#6139</a>. </p> <p> My last change was wrong, it isn't struct for Dinkumware. In GCC's standard library it's declared as a class, but later defined as a struct. This is so far untested as I'm building the latest trunk version of clang (the warning doesn't show for the current clang release). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Sun, 11 Dec 2011 21:43:04 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6139#comment:11 https://svn.boost.org/trac10/ticket/6139#comment:11 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</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/75909" title="Unordered: Fix `complex` type for gcc's standard library. Fixes #6139. ...">[75909]</a>) Unordered: Fix <code>complex</code> type for gcc's standard library. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6139" title="#6139: Bugs: error: &#34;BOOST_CLANG&#34; is not defined (closed: fixed)">#6139</a>. </p> <p> I haven't had any confirmation, but I assume this fixes the problem. </p> Ticket anonymous Mon, 12 Dec 2011 13:20:47 GMT <link>https://svn.boost.org/trac10/ticket/6139#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6139#comment:12</guid> <description> <p> Oops, the subject of that changeset should have started with 'Detail' not 'Unordered'. </p> </description> <category>Ticket</category> </item> </channel> </rss>