[comp.lang.c] Secure 'C' library, now _PROTO_ macro

daveb@gonzo.UUCP (Dave Brower) (11/14/88)

In article <14486@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes:
>
> FILE	*fmemopen _PROTO_((char *addr, unsigned int len, const char *mode));
>
> (The `_PROTO_(x)' macro expands to `x' if __STDC__, else to `'.)  [The
> prototypes in our <stdio.h> wreak minor havoc with GCC.  GCC needs more
> type-correctness internally.]
>

We're in the middle of making an ANSI migration strategy, and the moral
equivalent of _PROTO_(x) is one of the ideas.

What do others think of it as a practical solution? In particular, does
anyone know of Old-C environments that will have problems?

For instance, if you wrote Chris's example as:

FILE *fmemopen _PROTO_((
			char *addr,		/* destination buffer */
			unsigned int len,	/* size of the buffer */
			const char *mode	/* open parms, eg "w+" */
			));

it might fail miserably on, say old Whitesmith's compilers that forbid
multiple line macro invocations.

I'm looking for practical engineering considerations, not religious
dogma of the "it isn't C, so make the vendor fix it" ilk.

Thanks,
-dB


-- 
"It if was easy, we'd hire people cheaper than you to do it"

{sun,mtxinu,hoptoad}!rtech!gonzo!daveb		daveb@gonzo.uucp