[OpenAFS-devel] which OS's can't handle prototypes in kernel code?

Garance A Drosihn drosih@rpi.edu
Mon, 11 Jun 2001 13:43:10 -0400


At 8:40 AM -0500 6/11/01, Neulinger, Nathan wrote:
>Part of the cleanup patches I'm working on are cleaning up
>prototypes, and keeping track of where stuff might be used
>in the kernel is tricky. do we have any definite information
>as to what systems cannot handle prototypes in the kernel
>code?
>
>Is there an alternative that we might consider such as
>placing all prototypes in headers/sources within a
>
>#ifndef NO_PROTOTYPES
>#endif
>
>block that would be defined/undefined on command line for
>kernel code?

I believe that the more common way of handling this is to
use the __P() macro, which would be defined in sys/cdefs.h

That way, systems which do handle prototypes will get
prototypes, and systems which can not handle prototypes
will just see simple routine declarations (ie, just the
name of the routine will be defined, and not any of it's
parameters).

On the other hand, I'm generally in favor of just using
ANSI prototypes everywhere.  I deal with at least eight
different operating systems, and they all have compilers
which understand prototypes.

Also note that it's a *compiler* which would not understand
prototypes, not a "system".  So there may be OS's which have
compilers that do not understand prototypes, but those same
systems probably have some other C compiler available which
DOES know about prototypes.

-- 
Garance Alistair Drosehn            =   gad@eclipse.acs.rpi.edu
Senior Systems Programmer           or  gad@freebsd.org
Rensselaer Polytechnic Institute    or  drosih@rpi.edu