Boost C++ Libraries: Ticket #8021: gcc: ptree_utils.hpp:76: warning: comparison is always false due to limited range of data type [-Wtype-limits] https://svn.boost.org/trac10/ticket/8021 <p> gcc version 4.7.2 (Built by MinGW-builds project) i686-w64-mingw32 </p> <p> yields </p> <pre class="wiki">boost/property_tree/detail/ptree_utils.hpp: In instantiation of 'std::string boost::property_tree::detail::narrow(const Ch*) [with Ch = wchar_t; std::string = std::basic_string&lt;char&gt;]': boost/property_tree/string_path.hpp:64:36: required from here boost/property_tree/detail/ptree_utils.hpp:76:13: warning: comparison is always false due to limited range of data type [-Wtype-limits] 76: if (*text &lt; 0 || *text &gt; (std::numeric_limits&lt;char&gt;::max)()) </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8021 Trac 1.4.3 kailoran@… Sun, 10 Feb 2013 13:37:34 GMT attachment set https://svn.boost.org/trac10/ticket/8021 https://svn.boost.org/trac10/ticket/8021 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-8021a.diff</span> </li> </ul> <p> C++11-only patch to fix the warning </p> Ticket Gaurav Gupta <g.gupta@…> Tue, 04 Jun 2013 05:11:37 GMT <link>https://svn.boost.org/trac10/ticket/8021#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8021#comment:1</guid> <description> <p> I also faced this warning, with some Arm compiler. I applied a temporary fix by adding #pragma Macros in the header file. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Mateusz Loskot</dc:creator> <pubDate>Thu, 18 Jul 2013 08:36:50 GMT</pubDate> <title>description changed https://svn.boost.org/trac10/ticket/8021#comment:2 https://svn.boost.org/trac10/ticket/8021#comment:2 <ul> <li><strong>description</strong> modified (<a href="/trac10/ticket/8021?action=diff&amp;version=2">diff</a>) </li> </ul> Ticket Gaurav Gupta <g.gupta@…> Thu, 18 Jul 2013 08:49:13 GMT <link>https://svn.boost.org/trac10/ticket/8021#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8021#comment:3</guid> <description> <p> I removed this warning as below: </p> <p> #if defined(_MSC_VER) &amp;&amp; (_MSC_VER &gt;= 1020) # pragma once #else <em> for GCC compiler, treat as 'system header' to avoid compiler warnings in boost code # pragma GCC system_header #endif </em></p> </description> <category>Ticket</category> </item> <item> <dc:creator>Mateusz Loskot</dc:creator> <pubDate>Thu, 18 Jul 2013 09:04:13 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/8021#comment:4 https://svn.boost.org/trac10/ticket/8021#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">mateusz@…</span> added </li> </ul> Ticket