Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Nov 1996 06:16:21 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        current@freebsd.org, wollman@lcs.mit.edu
Subject:   Re: [Martha M. Gray: Availability of NIST-PCTS:151-2]
Message-ID:  <199611171916.GAA24742@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611171916.GAA24742>