[comp.os.minix] ibm:1.5.5: Compiler errors under TurboC

cagney@chook.ua.oz (Andrew Cagney - aka Noid) (03/19/90)

The TurboC compiler and the DECUS cpp detect the following errors that are
missed the ACK compiler tools miss.  This list is set out as a check list
rather than patches. Some are `a bit picky :-)'

kernel/mpx88.x
	The symbol C_RS323_INT_HANDLERS is used (line~67) before it is defined,
	by including <minix/config.h> (line~74). [See also the suggestion about
	rs2.x below (1)]

include/minix/config.h
	The symbol INTEL_32BITS is used but never defined. First use line~39.

include/unistd.h (line~98)
	The second parameter for the protype definition of lseek has type
	off__t, it should be type off_t.

tools/menu1.s (line~27)
	The external reference _boot_parameters is not delcared .globl at the
	start of the file.

tools/init.c (line~119 & line~191)
	The routine onhup, which is passed as a parameter to signal() is
	incorrectly declared. Currently it is declared to return an int,
	to be compatible with signal() it should return void (nothing).

include/stdargs.h vs that in stdio.h
	These two files use different type definitions for the `va_list' type.
	In stdargs.h it is `char *' while in stdio.h it is `void *'. I suggest
	that stdio.h:_STDIO_VA_LIST_ be changed to char * to be consistent.

Some 'picky points on style'. Several of the lib routines don't consistently
use `const' (_CONST) in their definition vs their declaration.  That is the
prototype declares constant parameters but the definition does not.

ansi/memmove.c vs include/string.h (line~21)
	Parameter two (s2) should be declared as
		_CONST void *s2;

ansi/strcoll.c vs include/string.h (line~28)
	Parameters one and two (s1 && s2) should be declared _CONST ...

ansi/strxfrm.c vs include/string.h (line~30)
	Parameter two (s2) should be declared _CONST ...


If you try TurboC, you will find that it reports an error (incorrectly) with
the following declarations:
	struct passwd *getpwuid(int _uid)		(in include/pwd.h)
  vs	struct passwd *getpwuid(__uid) uid_t __uid;	(in posix/getpwent.c)
TC claims that there is a type mismatch for _uid. TC gets this wrong. K&R
Ansi C book explains in some detail why it's not an error.

						Andrew Cagney
						cagney@cs.ua.oz.au

(1) rs2.x : I suggest that the rs2.x file be wraped up so that it looks like
		#include <minix/config.h>
		#if !C_RS323_INT_HANDLERS
		... existing rs2.x code with out #include <minix/config.h> ...
		#endif
	     so that this assembly is automatically enabled or disabled with
	     out needing to change the makefile.