Boost C++ Libraries: Ticket #6940: TIME_UTC is a macro in C11 https://svn.boost.org/trac10/ticket/6940 <p> Excerpt from the C11 standard draft that I have at hand: </p> <pre class="wiki">7.27 Date and time &lt;time.h&gt; The macros defined are [...] TIME_UTC which expands to an integer constant greater than 0 that designates the UTC time base. </pre><p> glibc implements this in development version, though the latest release (2.15) doesn't yet include this code. The Linux distribution Fedora rawhide (what is to become Fedora 18) now includes this code as well. </p> <p> This collides with the following code in boost/thread/xtime.hpp, which thus becomes invalid, as it includes &lt;ctime&gt; via &lt;boost/thread/thread_time.hpp&gt;. </p> <pre class="wiki">enum xtime_clock_types { TIME_UTC=1 [...] </pre><p> Unfortunately, on Linux, this is a problem in any C++ code. g++ implicitly defines _GNU_SOURCE, which in turn causes _ISOC11_SOURCE to be defined, regardless of what C++ standard is actually used. But regardless of this gcc feature, the boost interfaces are broken if I want to use C11 interfaces from C++ code. </p> <p> I couldn't find any recent documentation on this interface. It doesn't seem to be used much, and some old documentation (1.34) states that it will be obsoleted at some point. What would be used instead? </p> <p> Just dropping that enum would probably work in case of Fedora in particular, and that's what I'm going to do for boost package in Fedora. The type itself is never used. Users of the sole enum value would have to be changed from boost::TIME_UTC to mere TIME_UTC (taken from glibc), as the two happen to have the same value. That would be about it. But that's clearly not acceptable as an upstream solution. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6940 Trac 1.4.3 pmachata@… Thu, 24 May 2012 21:10:15 GMT <link>https://svn.boost.org/trac10/ticket/6940#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6940#comment:1</guid> <description> <p> Note, it would be possible to arrange for TIME_UTC value to be defined before &lt;ctime&gt; is (transitively) included, but that wouldn't be very useful: each client would have to undef TIME_UTC anyway, otherwise boost::TIME_UTC would be expanded and would become an invalid code. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 03 Jun 2012 18:18:06 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/6940#comment:2 https://svn.boost.org/trac10/ticket/6940#comment:2 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.51.0</span> </li> </ul> <p> Change done: replace TIME_UTC by TIME_UTC_. </p> <p> Committed in trunk at revision 78802. </p> Ticket viboes Sun, 03 Jun 2012 18:18:22 GMT owner, status changed https://svn.boost.org/trac10/ticket/6940#comment:3 https://svn.boost.org/trac10/ticket/6940#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket viboes Thu, 21 Jun 2012 21:17:30 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6940#comment:4 https://svn.boost.org/trac10/ticket/6940#comment:4 <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> Merged to release branch. </p> Ticket viboes Thu, 21 Jun 2012 21:17:48 GMT milestone changed https://svn.boost.org/trac10/ticket/6940#comment:5 https://svn.boost.org/trac10/ticket/6940#comment:5 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.51.0</span> → <span class="trac-field-new">Boost 1.50.0</span> </li> </ul> Ticket Mika Fischer <mika.fischer@…> Fri, 06 Jul 2012 10:04:50 GMT cc set https://svn.boost.org/trac10/ticket/6940#comment:6 https://svn.boost.org/trac10/ticket/6940#comment:6 <ul> <li><strong>cc</strong> <span class="trac-author">mika.fischer@…</span> added </li> </ul> Ticket Denis Arnaud Fri, 20 Jul 2012 12:36:41 GMT <link>https://svn.boost.org/trac10/ticket/6940#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6940#comment:7</guid> <description> <p> Just for the sake of having a link on the revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/78802" title="Thread: fix TIME_UTC, WINVER, constexpr for tags, and don't use local files">[78802]</a>, fixing issue <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6940" title="#6940: Bugs: TIME_UTC is a macro in C11 (closed: fixed)">#6940</a>. </p> </description> <category>Ticket</category> </item> <item> <author>smr@…</author> <pubDate>Mon, 13 May 2013 04:25:47 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/6940#comment:8 https://svn.boost.org/trac10/ticket/6940#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Despite the claim that this has been merged to release, Boost 1.53 still contains this bug. </p> Ticket viboes Tue, 21 May 2013 22:46:25 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6940#comment:9 https://svn.boost.org/trac10/ticket/6940#comment:9 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Please see <a class="ext-link" href="https://svn.boost.org/trac/boost/changeset/78973#file3"><span class="icon">​</span>https://svn.boost.org/trac/boost/changeset/78973#file3</a> </p> Ticket Will Karter Fri, 14 Feb 2014 10:21:03 GMT attachment set https://svn.boost.org/trac10/ticket/6940 https://svn.boost.org/trac10/ticket/6940 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">X ray Tech.jpg</span> </li> </ul> <p> Source </p> Ticket Will Karter Fri, 14 Feb 2014 10:21:05 GMT attachment set https://svn.boost.org/trac10/ticket/6940 https://svn.boost.org/trac10/ticket/6940 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">X ray Tech.2.jpg</span> </li> </ul> <p> Source </p> Ticket