From owner-freebsd-hackers Fri Jan 31 23:12:03 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id XAA08329 for hackers-outgoing; Fri, 31 Jan 1997 23:12:03 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA08306 for ; Fri, 31 Jan 1997 23:12:00 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.3/8.6.9) id SAA14153; Sat, 1 Feb 1997 18:09:43 +1100 Date: Sat, 1 Feb 1997 18:09:43 +1100 From: Bruce Evans Message-Id: <199702010709.SAA14153@godzilla.zeta.org.au> To: bde@zeta.org.au, terry@lambert.org Subject: Re: grp.h Cc: hackers@freebsd.org, proff@suburbia.net Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Doesn't POSIX actually mandate "int" in some of the prototypes? No. It says that applications may redeclare the standard functions using a declaration that is lexically identically to the one in the standard. This means that either all arg types must be the same as their default promotions, or the compiler must be ANSI. BSD requires the latter. For example, the following strictly POSIX conformant program does not compile if the compiler isn't ANSI: --- #define _POSIX_SOURCE 1 #include #include mode_t umask(mode_t); int main(void) { return 1; } ---- because mode_t is u_int16_t (which promotes to int if ints have 16 bits and to unsigned otherwise) and has declared umask() incompatibly as `mode_t umask();' if the compiler is non-ANSI. This also prevents from declaring umask() as `mode_t umask(promotion_of_u_int16_t);' which may be required for the __P(()) hack to actually work - this would break the above program for ANSI compilers. Bruce