Curious about function prototypes...

Doug Gwyn gwyn at brl-smoke.ARPA
Wed Jun 15 12:01:46 AEST 1988


In article <273 at spsspyr.UUCP> gunars at spsspyr.UUCP (Gunars V. Lucans) writes:
>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)
>	{
>		<body>
>	}

The above isn't even correct.  Try
	#if __STDC__
	void foo( int arg1, char *arg2 )
	#else
	void foo( arg1, arg2 )
		int arg1;
		char *arg2;
	#endif
	{
		/* body */
	}

>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?

Obviously AT&T must be planning to release an ANSI-compatible C compiler
as soon as they can after the standard stabilizes.  Give vendors who use
the AT&T CCS as a base about 6 months to a year after that to pick it up.
Those who base their compiler on 4BSD PCC have a harder task ahead of
them, although Chris Torek and others have been trying to bring the 4BSD
CCS up to ANSI/POSIX standards (not done yet).  GNU CC is already almost
there.  Most other C vendors I know of are preparing ANSI C releases.  My
guess is that two years after the official standard you'll be able to
obtain a Standard-conforming implementation for practically all systems
worth worrying about.



More information about the Comp.lang.c mailing list