Checks to see if unsigned integers < 0
davec-b at rogers.com
Tue Jul 16 05:04:50 MDT 2013
On 07/16/2013 01:53 AM, Volker Lendecke wrote:
> On Mon, Jul 15, 2013 at 01:35:34PM -0400, simo wrote:
>>> With this vague statement I am a bit reluctant to remove the
>>> uid<0 checks just because the most popular platform has that
>>> as an unsigned. Maybe we should #ifdef that somehow if it is
>>> a real problem?
>> Let's put it another way, do you know of any platform that does not
>> define it as a unsigned integer ?
> I do not know, but that does not mean this does not exist.
> That's why I was asking where Posix specifies it *has* to be
> an unsigned integer.
> Does someone else on this list have more insight on where
> Posix mandates that uid_t is unsigned?
That definition was to allow for variants that used a signed value. I
*think* David J. Brown proposed it that way because the second platform
v6 was ported to, the Interdata 7/32, used signed integer instructions
for everything except multiply/divide. I have a manual, and could look
it up if necessary.
You might want to put a check in configure to ensure that uids are
unsigned, or perhaps assertions before code that would fail if it was
applied to a signed uid.
David Collier-Brown, | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
davecb at spamcop.net | -- Mark Twain
More information about the samba-technical