Boost C++ Libraries: Ticket #9853: 'argument' : conversion from 'int' to 'char', possible loss of data https://svn.boost.org/trac10/ticket/9853 <p> boost_program_options.1.55.0.16\lib\native\src\parsers.cpp(223): warning C4242: 'argument' : conversion from 'int' to 'char', possible loss of data </p> <p> tolower returns 'int' and not 'char'. The cast must be used: </p> <div class="wiki-code"><div class="code"><pre><span class="n">result</span> <span class="o">+=</span> <span class="k">static_cast</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;</span><span class="p">(</span><span class="n">tolower</span><span class="p">(</span><span class="n">s</span><span class="p">[</span><span class="n">n</span><span class="p">]));</span> </pre></div></div><div class="wiki-code"><div class="code"><pre> <span class="n">string</span> <span class="n">result</span><span class="p">;</span> <span class="k">if</span> <span class="p">(</span><span class="n">s</span><span class="p">.</span><span class="n">find</span><span class="p">(</span><span class="n">prefix</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span> <span class="k">for</span><span class="p">(</span><span class="n">string</span><span class="o">::</span><span class="n">size_type</span> <span class="n">n</span> <span class="o">=</span> <span class="n">prefix</span><span class="p">.</span><span class="n">size</span><span class="p">();</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="n">s</span><span class="p">.</span><span class="n">size</span><span class="p">();</span> <span class="o">++</span><span class="n">n</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// Intel-Win-7.1 does not understand</span> <span class="c1">// push_back on string. </span> <span class="n">result</span> <span class="o">+=</span> <span class="n">tolower</span><span class="p">(</span><span class="n">s</span><span class="p">[</span><span class="n">n</span><span class="p">]);</span> <span class="p">}</span> </pre></div></div><p> P.S. Also it is better to use boost algorithm tolower on string rather than writing it by ourselves. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9853 Trac 1.4.3 Vladimir Prus Wed, 09 Apr 2014 10:07:47 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9853#comment:1 https://svn.boost.org/trac10/ticket/9853#comment:1 <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> This was previously fixed in <a class="ext-link" href="https://github.com/boostorg/program_options/commit/3ce1c74a0f0257d291c47e28bd2bae8385b69225"><span class="icon">​</span>https://github.com/boostorg/program_options/commit/3ce1c74a0f0257d291c47e28bd2bae8385b69225</a> </p> Ticket