[net.lang.c] ANSI C preprocessor

brooks@lll-crg.UUCP (Eugene D. Brooks III) (09/20/85)

Has anyone out there in netland implemented the #elif preprocessor
directive of the proposed ANSI standard in Reiser's preprocessor?
We would be interested in a set of context diffs if it would be
available.

meissner@rtp47.UUCP (Michael Meissner) (10/02/85)

In article <858@lll-crg.UUCP> brooks@lll-crg.UUCP (Eugene D. Brooks III) writes:
>Has anyone out there in netland implemented the #elif preprocessor
>directive of the proposed ANSI standard in Reiser's preprocessor?
>We would be interested in a set of context diffs if it would be
>available.
>

The System V.2 preprocessor has the #elif construct (which is where it came
from).

guy@sun.uucp (Guy Harris) (10/05/85)

> The System V.2 preprocessor has the #elif construct (which is where it came
> from).

Somehow, I don't think so:

	Script started on Fri Oct  4 22:20:57 1985
	gorodish$ cd /arch/s5r2/usr/src/cmd/cpp
	gorodish$ egrep ppsym cpp.c
	ppsym( s )              /* kludge */
	        defloc = ppsym( "define" );
	        udfloc = ppsym( "undef" );
	        incloc = ppsym( "include" );
	        elsloc = ppsym( "else" );
	        eifloc = ppsym( "endif" );
	        ifdloc = ppsym( "ifdef" );
	        ifnloc = ppsym( "ifndef" );
	        ifloc = ppsym( "if" );
	        lneloc = ppsym( "line" );
	        clsloc = ppsym( "class" );
	        idtloc = ppsym( "ident" );
	gorodish$ 

That's the VAX System V Release 2 (Version 1) distribution.  Maybe it's in
S5R2V2, or 3B S5R2V?, or whatever - it sure as heck ain't in the VAX S5R2V1
distribution.

	Guy Harris

hansen@pegasus.UUCP (Tony L. Hansen) (10/06/85)

In article <201@rtp47.UUCP> meissner@rtp47.UUCP (Michael Meissner) writes:
< In article <858@lll-crg.UUCP> brooks@lll-crg.UUCP (Eugene D. Brooks III) writes:
< >Has anyone out there in netland implemented the #elif preprocessor
< >directive of the proposed ANSI standard in Reiser's preprocessor?
< 
< The System V.2 preprocessor has the #elif construct (which is where it came
< from).

When the #elif construct was officially accepted by the AT&T C Standards
committee, it was too late to get it into the System Vr2 UNIX which was
going onto Vaxen and 3B-20's.  It was then added to the Vr2 C compiler which
came out later on the 3B-2's and 3B-5's.  I don't know about its existence
on other Vr2 ports, except the Amdahl, which does not have it.

Since it was already a part of AT&T's C standard by the time the ANSI
committee started up, it was added with almost no comment.

The ideas of #elifdef and #elifndef were also debated and rejected by AT&T's
committee.  (#elifdef was defeated mostly because of strong objections to
the four-word contraction in #elifndef, and the feeling that if one came in,
then both should come in.)

					Tony Hansen
					ihnp4!pegasus!hansen

gwyn@BRL.ARPA (VLD/VMB) (10/06/85)

> The System V.2 preprocessor has the #elif construct
> (which is where it came from).

Does not (but ought to).
Where did you get yours?

meissner@rtp47.UUCP (Michael Meissner) (10/09/85)

In article <1918@brl-tgr.ARPA> gwyn@BRL.ARPA (VLD/VMB) writes:
>> The System V.2 preprocessor has the #elif construct
>> (which is where it came from).
>
>Does not (but ought to).
>Where did you get yours?
>

Opps, the original ANSI proposal came from either the original base document
(which came from Bell Labs, adding in the enum stuff, structure copy, etc),
or from a proposal from them, indicating that `their' compiler already had
it (I don't remember).  I guess I naively assumed it was in System V, V.2, 
or V.2r2.  Maybe I should have to read nut.flame for a week (Oh nooooooo!)

	Michael Meissner
	Data General

gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (10/12/85)

The answer seems to be, #elif is in some releases of UNIX System V
and not in others.  It is now in BRL's System V emulation; copies
available to SVR2-licensed recipients that I already have on file.

Warning to anyone thinking of adding #elif to the Reiser CPP:
You need to record more state than `trulvl' and `flslvl'.