Path: utzoo!attcan!uunet!husc6!mailrus!iuvax!inuxc!att!chinet!spsspyr!gunars From: gunars@spsspyr.UUCP (Gunars V. Lucans) Newsgroups: comp.lang.c Subject: Re: Curious about function prototypes... Message-ID: <273@spsspyr.UUCP> Date: 13 Jun 88 20:46:51 GMT References: <654@orion.cf.uci.edu> <8073@brl-smoke.ARPA> Reply-To: gunars@spsspyr.UUCP (Gunars V. Lucans) Organization: SPSS - Chicago Lines: 41 In article <8073@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB)) writes: > ... New code should consistently use prototype style for both declarations >and definitions. Can anyone suggest how to code new style prototype definitions in a manner that would be portable to older compilers? For declarations, the following would suffice (from T.Plum's "Reliable Data Structures in C"): #ifdef PROTO_OK #define PARMS(x) x #else #define PARMS(x) () #endif void foo PARMS( (int arg1, char *arg2) ); Definitions are another matter. Is there an alternative (other than not using prototypes at all) to: void foo ( #ifdef PROTO_OK int #endif arg1, #ifdef PROTO_OK char * #endif arg2) { } What is the general level of compliance to the proposed standard in existing UNIX compilers? How soon can we expect the majority of them to be ANSI conforming, given that the market for UNIX compilers is different than that for MS-DOS compilers? ____________________________________________________________________________ Gunars V. Lucans -- SPSS Inc, Chicago -- ...!att!chinet!spsspyr!gunars -- ____________________________________________________________________________ Gunars V. Lucans -- SPSS Inc, Chicago -- ...!att!chinet!spsspyr!gunars