Re:Vulnerabilities Induced by Migrating to 64-Bit Platforms ...
by vardump on Sunday September 18, 2016 @03:14PM
(#12526687)
Thanks for the correction!
> only guaranteed to have the range [-1, SSIZE_MAX]
Oh, that's a weird type. I wonder if any compiler implementation encodes it with -1 bias, so that all bits 0 means "-1".
It could cause a disaster if/when ssize_t is encoded as anything else but standard twos complement signed number...
Re:Vulnerabilities Induced by Migrating to 64-Bit Platforms ...
by colejohnson66 on Sunday September 18, 2016 @03:26PM
(#12526745)
I'd assume it's just an unsigned number with 0xFF... representing -1. So counting would go (assuming 8 bits)
0xFC SSIZE_MAX - 2
0xFD SSIZE_MAX - 1
0xFE SIZE_MAX
0xFF -1
That makes more sense to me than a bias that the compiler would have to know about.
[1]: http://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/...