[comp.os.minix] estdio 2.1 problems

cechew@bruce.cs.monash.OZ.AU (Earl Chew) (12/20/90)

I received some mail from Martin Wiesemann about installing estdio 2.1 using
ack. He highlights two problems:

1. I didn't tar the names of the subdirectories, so tar won't create them.
   Sorry about that. This means that you will have to:

		mkdir FPTEST TEST INSTALL

   before attempting to untar the package. Hopefully I can fix this for next
   time.

2. You will get a warning when compiling vsprintf.c because of some underhanded
   pointer conversions. Hopefully I can fix it for next time.

3. ast got it wrong for 1.5.10 stdarg.h. The lines in question read:

typedef	char *va_list;

#define __vasz(x)		((sizeof(x)+sizeof(int)-1) & ~(sizeof(int) -1))

#define va_start(ap, parmN)	((ap) = (va_list)&parmN + __vasz(parmN))
#define va_arg(ap, type)      \
  (*((type *)((va_list)((ap) = (void *)((va_list)(ap) + __vasz(type))) \
						    - __vasz(type))))
#define va_end(ap)

   Now if you stare carefully at the definition of va_list and va_arg, you will
   see that the type of argument ap is char *. Thus the rhs of the
   subexpression:

		((ap) = (void *)((va_list)(ap) + __vasz(type)))

   must be of type char * --- but instead it's been cast to char *.
   Furthermore, ap which is of type char *, is cast to type va_list which is
   char *! It thus appears to me that whoever wrote this got a bit confused.
   ack doesn't know the rules about void *, so complains. This is not critical.
   I feel that a better way would be:
-------------------------------------------------------------------------------
*** stdarg.h.orig	Thu Dec 20 09:13:03 1990
--- stdarg.h	Thu Dec 20 09:21:01 1990
***************
*** 19
! typedef	char *va_list;

--- 19 -----
! typedef	void *va_list;
***************
*** 21
! #define __vasz(x)		((sizeof(x)+sizeof(int)-1) & ~(sizeof(int) -1))

--- 21 -----
! #define __vasz(x)	      ((sizeof(x)+sizeof(int)-1) & ~(sizeof(int) -1))
***************
*** 23
! #define va_start(ap, parmN)	((ap) = (va_list)&parmN + __vasz(parmN))

--- 23,24 -----
! #define va_start(ap, parmN)   \
!   ((ap) = (void *)((char *)&(parmN) + __vasz(parmN)))
***************
*** 25
!   (*((type *)((va_list)((ap) = (void *)((va_list)(ap) + __vasz(type))) \

--- 26 -----
!   (*((type *)((char *)((ap) = (void *)((char *)(ap) + __vasz(type))) \
-------------------------------------------------------------------------------
   Note the similarity between the definitions of va_start and va_arg.

4. There is a typo in the `clean' target of the makefile. The rm line should
   read:

		rm -f $$e ;

   The root of the problem is in makefile.cpp. I'll fix it for the next
   release.

Earl
-- 
Earl Chew, Dept of Computer Science, Monash University, Australia 3168
EMAIL: cechew@bruce.cs.monash.edu.au PHONE: 03 5655447 FAX: 03 5655146
----------------------------------------------------------------------