fam
[Top] [All Lists]

Re: Possible bug in FAM?

To: Joerg Wendland <joergland@xxxxxxxxxx>
Subject: Re: Possible bug in FAM?
From: Michael Wardle <michael.wardle@xxxxxxxxxx>
Date: 18 Oct 2002 11:34:02 +1000
Cc: fam@xxxxxxxxxxx
In-reply-to: <20021017172435.GA12281@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <20021017172435.GA12281@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: fam-bounce@xxxxxxxxxxx
On Fri, 2002-10-18 at 03:24, Joerg Wendland wrote:
> I am currently trimming FAM 2.6.9 to compile under G++ 3.2 without
> warnings. G++ gripes at the following line (Cred.c++:97):
> 
>    primary_group = untrusted.is_valid() ? untrusted.gid() : NOGROUP;
> 
> Under Linux/i386 (dunno about others) NOGROUP is defined in asm/params.h
> as -1 so G++ correctly sees a possible assignment of a signed int to
> an unsigned int (gid_t primary_group).

On IRIX and FreeBSD, NOGROUP (or equivalent) is a positive constant.  On
the GNU/Linux systems I tested on (where NOGROUP is -1), primary_group
is set to UMAX_INT+(-1) if untrusted.is_valid() is false.

I think casting NOGROUP to a gid_t would be sensible, nonetheless, which
should also remove the warning.

Thanks for pointing that out.

-- 
MICHAEL WARDLE
SGI Applications Team
Adacel Technologies



<Prev in Thread] Current Thread [Next in Thread>