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
|