Boost C++ Libraries: Ticket #4791: boost/token_functions.hpp: warning isspace/ispunct called with wrong character type https://svn.boost.org/trac10/ticket/4791 <p> When using a date_time parser, MSVC reports warning C6328 because ispunct / iswpunct and isspace/iswspace are called with the wrong type. </p> <p> The char_type should be extended to int / wint_t to accomodate all valid values and EOF/WEOF. </p> <p> The following patch (against 1.44.0) solves the issue. </p> <pre class="wiki">=== modified file boost/token_functions.hpp --- boost/token_functions.hpp 2010-10-07 09:40:43 +0000 +++ boost/token_functions.hpp 2010-10-25 11:25:48 +0000 @@ -218,9 +218,9 @@ { #if !defined(BOOST_NO_CWCTYPE) if (sizeof(char_type) == 1) - return std::isspace(c) != 0; + return std::isspace(static_cast&lt;int&gt;(c)) != 0; else - return std::iswspace(c) != 0; + return std::iswspace(static_cast&lt;std::wint_t&gt;(c)) != 0; #else return static_cast&lt; unsigned &gt;(c) &lt;= 255 &amp;&amp; std::isspace(c) != 0; #endif @@ -230,9 +230,9 @@ { #if !defined(BOOST_NO_CWCTYPE) if (sizeof(char_type) == 1) - return std::ispunct(c) != 0; + return std::ispunct(static_cast&lt;int&gt;(c)) != 0; else - return std::iswpunct(c) != 0; + return std::iswpunct(static_cast&lt;std::wint_t&gt;(c)) != 0; #else return static_cast&lt; unsigned &gt;(c) &lt;= 255 &amp;&amp; std::ispunct(c) != 0; #endif </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4791 Trac 1.4.3 Marshall Clow Sat, 27 Nov 2010 20:47:27 GMT owner, status changed https://svn.boost.org/trac10/ticket/4791#comment:1 https://svn.boost.org/trac10/ticket/4791#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">jsiek</span> to <span class="trac-author">Marshall Clow</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Marshall Clow Mon, 29 Nov 2010 21:17:58 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4791#comment:2 https://svn.boost.org/trac10/ticket/4791#comment:2 <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/66855" title="Merge patch to release; fixes #4791">[66855]</a>) Merge patch to release; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4791" title="#4791: Patches: boost/token_functions.hpp: warning isspace/ispunct called with wrong ... (closed: fixed)">#4791</a> </p> Ticket Kazutoshi Satoda <k_satoda@…> Sat, 22 Jan 2011 09:04:44 GMT <link>https://svn.boost.org/trac10/ticket/4791#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4791#comment:3</guid> <description> <p> A related patch <a class="new ticket" href="https://svn.boost.org/trac10/ticket/5086" title="#5086: Patches: Fix for possible assertion failure in MSVC isctype.c (new)">#5086</a> was submitted. </p> </description> <category>Ticket</category> </item> </channel> </rss>