🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5617

Re: ANSI C token set (including $ and @)

#5617
From: Larry Jones
Date: Wed, 18 Jan 1989 22:47
35 lines
1932 bytes
In article <1989Jan16.204214.15979@utzoo.uucp>, henry@utzoo.uucp (Henry Spencer) writes:
> In article <11383@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes:
> >`Strictly conforming' is an attribute of programs, not implementations.  An
> >implementation is either ANSI C, or it isn't.  According to the rules,
> >accepting `$' in an identifier seems to yield a non-ANSI implementation.
> 
> Only if it is not diagnosed (e.g. by a warning message).  I'm getting a
> bit tired of repeating this:  accepting extensions does not make a compiler
> non-conforming.  The requirements for a conforming implementation are that
> it handle all strictly conforming programs correctly, and that it diagnose
> (not necessarily reject, just diagnose) any construct which is illegal
> according to the standard.

That's what I thought, too.  But Karl pointed out to me that is
is possible to write a strictly conforming program that will NOT
be interpreted correctly by an implementation that allows '$' in
identifiers.  All you need do is something like:

	#define foo$bar
	#ifdef foo
	.
	.
	.
	#endif

The standard requires the #ifdef to be true, but any
implementation that allows '$' in an identifier will evaluate it
as false.

----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                      scjones@sdrc.UU.NET
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150                  AT&T: (513) 576-2070
"When all else fails, read the directions."
Technical Details
Message-ID: <504@sdrc.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!sdrc!scjones
References: <11343@haddock.ima.isc.com> <1858@zell.cs.vu.nl> <1989Jan16.204214.15979@utzoo.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!sdrc!scjones
From: scjones@sdrc.UUCP (Larry Jones)
Newsgroups: comp.std.c
Subject: Re: ANSI C token set (including $ and @)
Message-ID: <504@sdrc.UUCP>
Date: 18 Jan 89 22:47:19 GMT
References: <11343@haddock.ima.isc.com> <1858@zell.cs.vu.nl> <1989Jan16.204214.15979@utzoo.uucp>
Organization: Structural Dynamics Research Corp., Cincinnati
Lines: 35