Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: availability of ANSI-conformant compilers Keywords: ANSI compiler availability Message-ID: <14504@smoke.brl.mil> Date: 17 Nov 90 14:21:36 GMT References: <16440@csli.Stanford.EDU> <14487@smoke.brl.mil> <16457@csli.Stanford.EDU> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 24 In article <16457@csli.Stanford.EDU> poser@csli.stanford.edu (Bill Poser) writes: >Doesn't this mean that you either don't use prototypes or have to >include both a prototype and a non-prototyped declaration for every >function? There is no requirement to use prototypes even in an ANSI C environment. However, in fact we do use them, in order to obtain the benefit of compile-time parameter type checking ("lint" can also do this) and especially possible violations of "const" parameter qualification. While we don't do anything particularly slick in declaring functions both ways, there are methods for automating this, e.g. /* in your system configuration header: */ #ifdef __STDC__ #define ARGS(args) args #else #define ARGS(args) () #endif /* in your module/package headers: */ #include "std.h" /* the above system configuration header */ extern bool FunkyFunc ARGS((int number, char *name)); /* etc. */ You could also do something similar for function definitions.