From owner-freebsd-current Sun Nov 17 11:21:11 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA03664 for current-outgoing; Sun, 17 Nov 1996 11:21:11 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id LAA03620 for ; Sun, 17 Nov 1996 11:21:01 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.7.6/8.6.9) id GAA24742; Mon, 18 Nov 1996 06:16:21 +1100 Date: Mon, 18 Nov 1996 06:16:21 +1100 From: Bruce Evans Message-Id: <199611171916.GAA24742@godzilla.zeta.org.au> To: current@freebsd.org, wollman@lcs.mit.edu Subject: Re: [Martha M. Gray: Availability of NIST-PCTS:151-2] Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Like it says.... >... >This PCTS and its associated documents are available for download via the URL: > http://www.itl.nist.gov/div897/ctg/posix_form.htm Most of the tests fail under FreeBSD due to bugs in the tests and good error checking in FreeBSD. The behaviour of va_arg(ap, type) is undefined if `type' is not compatible with the type of the actual next argument (as promoted according to the default promotions). The tests are careful to avoid this problem in some cases but not all. After fixing this I get 1735 PASSes and only 87 FAILures for a kernel that already has some POSIX bugs fixed. Bruce *** sv_expect.c~ Tue Jun 15 02:47:45 1993 --- sv_expect.c Mon Nov 18 04:33:37 1996 *************** *** 44,48 **** sv_svalu(sv_xenv); /* set valu flag */ va_start(ap, format); ! c_saved = va_arg(ap, char); va_end(ap); va_start(ap, format); --- 44,48 ---- sv_svalu(sv_xenv); /* set valu flag */ va_start(ap, format); ! c_saved = (char)va_arg(ap, int); va_end(ap); va_start(ap, format); *************** *** 63,67 **** va_end(ap); va_start(ap, format); ! us_saved = va_arg(ap, unsigned short); /*Lint will not complain of ptr. alignment problems after this point*/ va_end(ap); --- 63,70 ---- va_end(ap); va_start(ap, format); ! if(sizeof(unsigned short) < sizeof(int)) ! us_saved = (unsigned short)va_arg(ap, int); ! else ! us_saved = va_arg(ap, unsigned short); /*Lint will not complain of ptr. alignment problems after this point*/ va_end(ap); *************** *** 71,74 **** --- 74,81 ---- va_start(ap, format); if(sizeof(pid_t) < sizeof(int)) + /* + * XXX can pid_t be float? Then this is wrong. + * Similarly elsewhere. + */ pid_t_saved = (pid_t)va_arg(ap, int); else *************** *** 88,94 **** --- 95,103 ---- va_end(ap); va_start(ap, format); + /* XXX wrong, clock_t may be smaller than int. */ clk_t_saved = va_arg(ap, clock_t); va_end(ap); va_start(ap, format); + /* XXX wrong, off_t may be smaller than int. */ off_t_saved = va_arg(ap, off_t); va_end(ap); *************** *** 112,115 **** --- 121,125 ---- va_end(ap); va_start(ap, format); + /* XXX wrong, time_t may be smaller than int. */ time_t_saved = va_arg(ap, time_t); va_end(ap);