Boost C++ Libraries: Ticket #5761: warning im MPL source https://svn.boost.org/trac10/ticket/5761 <p> I get warning in Visual C++ 10, 32 bit mode (strangely, 64 bit mode is warning free): </p> <p> p:\app\3pp\boost\mpl\print.hpp(51): warning C4308: negative integral constant converted to unsigned type </p> <p> It is line: </p> <blockquote> <p> enum { n = sizeof(T) + -1 }; </p> </blockquote> <p> Changing it into: </p> <blockquote> <p> enum { n = sizeof(T) - 1 }; </p> </blockquote> <p> got rid the warning. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5761 Trac 1.4.3 Alexander Lobov <alexanderlobov@…> Tue, 10 Apr 2012 11:29:03 GMT attachment set https://svn.boost.org/trac10/ticket/5761 https://svn.boost.org/trac10/ticket/5761 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">print.patch</span> </li> </ul> <p> Patch for trunk svn version </p> Ticket Alexander Lobov <alexanderlobov@…> Tue, 10 Apr 2012 11:30:36 GMT <link>https://svn.boost.org/trac10/ticket/5761#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5761#comment:1</guid> <description> <p> Why not </p> <pre class="wiki">enum { n = sizeof(T) + 1 }; </pre><p> ? </p> <p> I've attached patch for this version. </p> </description> <category>Ticket</category> </item> <item> <author>surfersparadise85-sonstiges@…</author> <pubDate>Mon, 22 Apr 2013 13:12:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5761#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5761#comment:2</guid> <description> <p> Why was this not committed to the base? I still get the same error with boost 1.53 unless I change the line as denoted above. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 07 Jul 2013 04:11:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5761#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5761#comment:3</guid> <description> <p> Just encountered this in 1.54 why not fixed yet ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Tue, 01 Apr 2014 00:59:24 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5761#comment:4 https://svn.boost.org/trac10/ticket/5761#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">invalid</span> </li> </ul> <p> This is not a bug. mpl::print is supposed to generate a warning. Check the template instantiation backtrace to find the reason for the warning. </p> Ticket