Boost C++ Libraries: Ticket #4201: boost/asio/detail/socket_ops.hpp:1305: isdigit called with char, not unsigned char https://svn.boost.org/trac10/ticket/4201 <p> As of <a class="changeset" href="https://svn.boost.org/trac10/changeset/61840" title="move library review has been scheduled. ">r61840</a> file boost/asio/detail/socket_ops.hpp at function gai_serv, there is a call on line 1305 to isdigit which passes serv<a class="missing changeset" title="No changeset 0 in the repository">[0]</a>, where serv is declared as a const char*. This causes warning C6328 from the Microsoft code analysis tool PREfast, because isdigit should take an unsigned char, but char is signed if not otherwise specified. Some implementations of ctype.h functions assume that the input is in the range [0, 255], and will misbehave if given a value less than zero. The attached patch requests that the compiler zero-extend the value, which both removes the warning and fixes the problem that the warning is intended to address. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4201 Trac 1.4.3 anonymous Fri, 07 May 2010 22:16:14 GMT attachment set https://svn.boost.org/trac10/ticket/4201 https://svn.boost.org/trac10/ticket/4201 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">foo</span> </li> </ul> <p> Patch to boost/asio/detail/socket_ops.hpp to add a static_cast to ensure use of a zero-extending move of serv<a class="missing changeset" title="No changeset 0 in the repository">[0]</a> </p> Ticket chris_kohlhoff Tue, 08 Jun 2010 09:01:41 GMT <link>https://svn.boost.org/trac10/ticket/4201#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4201#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/62556" title="Ensure unsigned char is used with isdigit. Refs #4201. ">[62556]</a>) Ensure unsigned char is used with isdigit. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4201" title="#4201: Bugs: boost/asio/detail/socket_ops.hpp:1305: isdigit called with char, not ... (closed: fixed)">#4201</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Wed, 09 Jun 2010 09:41:14 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4201#comment:2 https://svn.boost.org/trac10/ticket/4201#comment:2 <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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/62644" title="Merge from trunk. ........ r62497 | chris_kohlhoff | 2010-06-07 ...">[62644]</a>) Merge from trunk. </p> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/62497" title="Fix handling of small but non-zero timeouts. Fixes #4205. ">r62497</a> | chris_kohlhoff | 2010-06-07 09:28:58 +1000 (Mon, 07 Jun 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Fix handling of small but non-zero timeouts. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4205" title="#4205: Bugs: Excessive CPU using in run_one in ASIO (closed: fixed)">#4205</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/62499" title="Reworked implementation MkII ">r62499</a> | chris_kohlhoff | 2010-06-07 10:00:45 +1000 (Mon, 07 Jun 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Reworked implementation MkII. Also fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4170" title="#4170: Bugs: Error using null_buffers in async_send_to in Windows (closed: fixed)">#4170</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/62530" title="Fixes for MSVC 7.1, Borland. ">r62530</a> | chris_kohlhoff | 2010-06-08 09:24:28 +1000 (Tue, 08 Jun 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Fixes for MSVC 7.1, Borland. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/62531" title="Some changes for Symbian support. ">r62531</a> | chris_kohlhoff | 2010-06-08 09:29:05 +1000 (Tue, 08 Jun 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Some changes for Symbian support. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/62549" title="Fix typo in tutorial. Refs #4252. ">r62549</a> | chris_kohlhoff | 2010-06-08 14:27:26 +1000 (Tue, 08 Jun 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Fix typo in tutorial. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4252" title="#4252: Bugs: Typoo in boost::asio tutorial (closed: fixed)">#4252</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/62556" title="Ensure unsigned char is used with isdigit. Refs #4201. ">r62556</a> | chris_kohlhoff | 2010-06-08 19:01:39 +1000 (Tue, 08 Jun 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Ensure unsigned char is used with isdigit. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4201" title="#4201: Bugs: boost/asio/detail/socket_ops.hpp:1305: isdigit called with char, not ... (closed: fixed)">#4201</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/62558" title="Fix handling of empty buffer sequences. ">r62558</a> | chris_kohlhoff | 2010-06-08 21:01:57 +1000 (Tue, 08 Jun 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Fix handling of empty buffer sequences. </p> </blockquote> <p> ........ </p> Ticket