Re: signed vs unsigned

2016-03-23 Thread Thiago Macieira
On quarta-feira, 23 de março de 2016 09:53:04 PDT Robert Helling wrote: > Anyway, my conclusion from all this trouble in the past was to _always_ use > the signed version since this prevents the trouble. As far as I can see, > the potential cost is that the maximally representable number is only

Re: signed vs unsigned

2016-03-23 Thread Dirk Hohndel
gets when building for iOS (where these >> warnings are forced on). And in the process I tried to be smart and use >> signed vs unsigned in ways that made sense given what the variables >> actually were supposed to contain. > > to continue in this vain, I did a git grep uns

Re: signed vs unsigned

2016-03-23 Thread Robert Helling
t; > The initial reason for doing all this "cleanup" work was to silence the > more than a thousand warnings one gets when building for iOS (where these > warnings are forced on). And in the process I tried to be smart and use > signed vs unsigned in ways that made sense giv

Re: signed vs unsigned

2016-03-23 Thread Dirk Hohndel
, I see, > there is -Wconversion). The reason I did this patch (and a few others like it) is exactly what you say here. Mixing signed and unsigned doesn't always work the way the programmer naively expects. And when turning on the warnings for signed vs. unsigned comparisons or assignments, I tried to cl