Opened 9 years ago
Closed 9 years ago
#9853 closed Bugs (fixed)
'argument' : conversion from 'int' to 'char', possible loss of data
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | To Be Determined | Component: | program_options |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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
tolower returns 'int' and not 'char'. The cast must be used:
result += static_cast<char>(tolower(s[n]));
string result; if (s.find(prefix) == 0) { for(string::size_type n = prefix.size(); n < s.size(); ++n) { // Intel-Win-7.1 does not understand // push_back on string. result += tolower(s[n]); }
P.S. Also it is better to use boost algorithm tolower on string rather than writing it by ourselves.
Note:
See TracTickets
for help on using tickets.
This was previously fixed in https://github.com/boostorg/program_options/commit/3ce1c74a0f0257d291c47e28bd2bae8385b69225