Subject: Re: strict typechecking on kernel compiles
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: current-users
Date: 07/22/1995 21:29:08
>> For my own code, I do.  I use wgcc, which is a wrapper script for
>> gcc -Werror -W -Wall -Wpointer-arith -Wcast-qual -Wwrite-strings
>> -Wstrict-prototypes -Wmissing-prototypes -Wno-uninitialized.

> I wonder if this isn't *too* strong for the kernel -- in particular,
> for ``polymorphic'' structs-of-function-pointers, like protosw?

You just have to declare them as something like

	int (*proto_input)(struct something *, ...);

(and of course implement them with <stdarg.h>).  Polymorphic functions
_are_ what the "..." notation is for.

> This isn't going to pass strong typechecking unless the kernel is
> transliterated into C++ (gack).

Without a polymorphic language, you can't get strong typechecking out
of a polymorphic interface.  Fortunately C has an escape (specifically,
stdarg functions) for polymorphic functions, so we can prototype them
even though we can't get real typechecking.

					der Mouse