[tz] localtime.c patch
Clive D.W. Feather
clive at davros.org
Tue Oct 14 15:36:17 UTC 2014
Paul Eggert said:
>> I can see that POSIX says "The type
>> ssize_t shall be capable of storing values at least in the range [-1,
>> {SSIZE_MAX}].", but that doesn't exempt it from the C rules concerning
>> types.
>
> Well, in *theory* ssize_t could be an extended integer type using one's
> complement and SSIZE_MAX could be 1, no?
Indeed. Note that SSIZE_MAX is a POSIX value and is not necessarily the
largest value of ssize_t.
> As far as I can tell nothing
> in the C standard prohibits that, and that would mean one couldn't
> necessarily store -2 into an ssize_t variable.
I was about to say that extended integer types have to at least have the
range of signed or unsigned char, as appropriate, but I can't find any such
rule. So it does seem that you could have such a type. Mutter.
> Of course this is purely a theoretical objection, but I've always been
> suspicious of that POSIX rule about -1 and ssize_t -- the rule must be
> there for a reason, though they don't explain the reason
I'd always assumed that that notation showed the values that POSIX puts in
variables of that type.
--
Clive D.W. Feather | If you lie to the compiler,
Email: clive at davros.org | it will get its revenge.
Web: http://www.davros.org | - Henry Spencer
Mobile: +44 7973 377646
More information about the tz
mailing list