DragonFly commits List (threaded) for 2005-03
Re: cvs commit: src/lib/libc/sys tls.2
On Mon, 21 Mar 2005 11:37:27 -0800 (PST)
Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx> wrote:
> :On Mon, 21 Mar 2005 11:15:32 -0800 (PST)
> :Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx> wrote:
> :> Grumble (Matt goes off in a corner and mumbles about stupid
> standards :> which use unsigned ints because some bozo wanted to
> write 2.1GB of data :> in one go, when they really ought to just
> use normal ints). :
> :Why ought they do that?
> :(or: why would one ever want a *negative* infosize?!)
> It's not that, it's the same issue with sizeof() returning
> unsigned when it really just ought to return an int.
Oh heck yeah. I'm not sure about the other reasons, but this one alone
takes the cake.
I wouldn't say it should return an int, though: IMO sizeof(x) ought to
be treated just like any other numeric constant in C - that is,
interpreted as signed or unsigned as the situation dictates. Why they
introduced this gratuitous unorthogonality, I have no idea. Well, maybe
that's not strictly true... I _can_ guess. Probably "sizeof always
yields a positive number so we should force its type to be unsigned."
But that makes exactly as much sense as "4 always yields a positive
number so we should force its type to be unsigned," which is stupid.