Article View: comp.std.c
Article #5506What validation suites can't do (was Re: __STDC__ and non-strictly conforming ANSI C compilers)
From: Barry Margolin
Date: Fri, 16 Dec 1988 20:36
Date: Fri, 16 Dec 1988 20:36
27 lines
1798 bytes
1798 bytes
In article <5202@bsu-cs.UUCP> dhesi@bsu-cs.UUCP (Rahul Dhesi) writes:
>Perhaps a solution would be for somebody to come up with a C compiler
>validation suite, and also a trade-marked term such as "__VALIDC__".
Unfortunately, a validation suite would have a hard time failing an
implementation that has extensions that define new reserved words. It
would only fail if it happened to use one of the new reserved words as
an ordinary identifier. You can try to catch some of the more common
extensions by trying to use "near", "far", and "asm" as identifiers,
but how are you going to guess that my implementation reserves the
word "frobnicate"?
Similarly, suppose an implementation defines a new operator, using a
syntax that is undefined by the standard (e.g. the much-discussed "^^"
short-circuit XOR :-). How would a validation suit discover this
invalidity?
The latter case isn't as much of a problem as the former, because it
only causes non-conforming programs to work. Defining new reserved
words in the user namespace can cause strictly-conforming programs to
fail.
Barry Margolin
Thinking Machines Corp.
barmar@think.com
{uunet,harvard}!think!barmar
Technical Details
Message-ID:
<33611@think.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!cwjcc!ukma!mailrus!ames!think!barmarReferences:
<3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL> <721@auspex.UUCP> <5202@bsu-cs.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!cwjcc!ukma!mailrus!ames!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.std.c Subject: What validation suites can't do (was Re: __STDC__ and non-strictly conforming ANSI C compilers) Keywords: ANSI C, __STDC__ Message-ID: <33611@think.UUCP> Date: 16 Dec 88 20:36:02 GMT References: <3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL> <721@auspex.UUCP> <5202@bsu-cs.UUCP> Sender: news@think.UUCP Reply-To: barmar@kulla.think.com.UUCP (Barry Margolin) Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 27