Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3634: to_upper / to_lower incorrect for machines with signed chars
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-01-10 18:08:03
#3634: to_upper / to_lower incorrect for machines with signed chars
------------------------------------------------------+---------------------
Reporter: Thomas Dorner <td-eclipse@â¦> | Owner: marshall
Type: Bugs | Status: new
Milestone: Boost 1.41.0 | Component: algorithm
Version: Boost 1.40.0 | Severity: Problem
Resolution: | Keywords:
------------------------------------------------------+---------------------
Comment (by marshall):
Replying to [comment:3 pavol_droba]:
> Looking at the problem again, I think that the problem actually lies in
Solaris's C++ locales. There is nothing wrong with chars being signed.
>
> Anyway, I'll try to check it out and come up with a solution.
I'm coming to that conclusion, too.
The C versions of `tolower`, et. al. take an `int` as a parameter. The C99
standard (section 7.4.1) says that the input to tolower needs to be
representable as unsigned char, or EOF. To me that means "no negative
numbers". Microsoft has a page that talks about this issue, too:
http://msdn.microsoft.com/en-us/library/ms245348.aspx
However, the C++ version `std::tolower`, takes a `char` (templated) as a
parameter, and I can't find any similar restriction in either the C++03
standard or the (draft) C++11 standard. To me, that means that all
possible values of `char` are allowable (or whatever type the function is
templated upon)
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3634#comment:6> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC