From owner-freebsd-arch Wed Apr 25 15:25:58 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 55C2437B423 for ; Wed, 25 Apr 2001 15:25:55 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id IAA20732; Thu, 26 Apr 2001 08:25:49 +1000 Date: Thu, 26 Apr 2001 08:24:48 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Peter Pentchev Cc: arch@FreeBSD.ORG Subject: Re: gid_t vs. plain int In-Reply-To: <20010425183640.C54687@ringworld.oblivion.bg> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 25 Apr 2001, Peter Pentchev wrote: > Is there a reason that struct group in does not define 'gr_gid' > as a gid_t value, but as a plain int? This makes all kinds of things Historical reasons, and because wollman still hasn't committed his header cleanups which fix this and many other related problems. > go berserk with gcc -Wall -W, and causes dozens of (totally unneeded) > casts. The casts might be needed to support K&R compilers on systems with sizeof(gid_t) < sizeof(int), but mostly make things worse by hiding bugs. > Is there some standard that says pw_gid is gid_t, but gr_gid is int? POSIX.1-1990 says that both are gid_t. BTW, the kernel still uses int for gids in many places, e.g., kern/syscalls.master says that chown(2) takes an "int gid" arg. This depends on various type puns to work. Similarly for many other syscall args. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message