On Mon, May 19, 2014 at 3:09 PM, Georg Baum
wrote:
> Please be careful with "never expected to be large". The warning you are
> adressing is about a subtle error which usually does not occur, but there is
> a small chance that it can occur. When fixing warnings like that I very much
> prefer to f
Am Dienstag, 20. Mai 2014 schrieb Cyrille Artho:
> > It is the correct type on linux as well. Therefore, the approach
> > suggested by Cyrille is IMHO the best one: Change the type of nRead
> > to ssize_t (note the two s), and change the if-condition to
> >
> > if (static_cast(nRead) < buf.size()
It is the correct type on linux as well. Therefore, the approach suggested
by Cyrille is IMHO the best one: Change the type of nRead to ssize_t (note
the two s), and change the if-condition to
if (static_cast(nRead) < buf.size() - 1) {
This is 100% safe: We know that nRead > 0 at the time the
Cyrille Artho wrote:
> Scott Kostyshak wrote:
>> On Sun, May 18, 2014 at 7:58 PM, Richard Heck wrote:
>>> On 05/18/2014 07:22 PM, Scott Kostyshak wrote:
Is this OK? Note that converting the left hand side to an unsigned int
would work also, because it was checked just above that nR
Scott Kostyshak wrote:
On Sun, May 18, 2014 at 7:58 PM, Richard Heck wrote:
On 05/18/2014 07:22 PM, Scott Kostyshak wrote:
Is this OK? Note that converting the left hand side to an unsigned int
would work also, because it was checked just above that nRead is >=0.
But I figure converting the s
On Sun, May 18, 2014 at 7:58 PM, Richard Heck wrote:
> On 05/18/2014 07:22 PM, Scott Kostyshak wrote:
>>
>> Is this OK? Note that converting the left hand side to an unsigned int
>> would work also, because it was checked just above that nRead is >=0.
>> But I figure converting the signed to unsig
On 05/18/2014 07:22 PM, Scott Kostyshak wrote:
Is this OK? Note that converting the left hand side to an unsigned int
would work also, because it was checked just above that nRead is >=0.
But I figure converting the signed to unsigned is better in general as
long as the numbers are not expected t