Boost logo

Boost :

Subject: Re: [boost] [Convert] std::isspace requires unsigned #28
From: Vladimir Batov (Vladimir.Batov_at_[hidden])
Date: 2017-03-20 20:07:04


On 2017-03-20 22:13, Peter Dimov via Boost wrote:
> Vladimir Batov wrote:
>> ...
>> We discussed it on https://github.com/boostorg/convert/issues/28.
>
> The analyzer is correct; passing char to isspace is a well-known bug,
> should be cast to unsigned char. The accepted range of the argument to
> isspace is -1..255 (assuming 8 bit character table), with -1 being
> EOF, and the default promotion from char to int doesn't do the right
> thing when char is signed.

Thanks, Peter, for clarifications. Clearly, the analyzer is correct. My
interpretation was that it was the documented isspace() behavior. So, I
felt somewhat uncomfortable "correcting"/changing the documented
behavior. Now that you mention that it is a well-known bug to be
(unfortunately) addressed I did just that. Thanks again. Much
appreciated.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk