🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5845

Re: Semi-reserved namespace, revisited

#5845
From: Doug Gwyn
Date: Thu, 30 Mar 1989 16:54
40 lines
2044 bytes
In article <12209@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes:
>I presume this means that the application is permitted to use these names
>for non-external identifiers.

Well, you didn't cite the rules accurately.  All identifiers that begin
with an underscore are always reserved for use as identifiers with file
scope in both the ordinary identifier and tag name spaces.  Thus, struct/
union tags starting with an underscore must never be used by a strictly
conforming program.

>the following program seems to be strictly conforming:
>	#include <stdio.h>
>	int main(void) {
>	    char *_iob;
>	    fprintf(stdout, "goodbye, world!\n");
>	    return 0;
>	}
>If so, this implies that the common implementation of <stdio.h> is illegal

Certainly the definition of `stdout' in <stdio.h> as
	#define	stdout	(&_iob[1])
	extern FILE	_iob[];
is not standard conforming, as you illustrate with your example.
Having `_iob' as an ordinary identifier in file scope is not a problem,
but the use of a non-reserved identifier in the definition of the
`stdout' macro is a problem.

>If the program
>	#define _ptr char *
>	#include <stdio.h>
>	int main(void) { return 0; }
>is strictly conforming, it implies that <stdio.h> may not use _ptr ...

But that's not strictly conforming, because ordinary identifiers in
file scope are reserved, and the program is in violation of that
constraint.

>Are implementors prepared to make these modifications to the common headers?

The implementors are obliged to conform to the standard, yessir.
Technical Details
Message-ID: <9954@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!purdue!haven!adm!smoke!gwyn
References: <12209@haddock.ima.isc.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!purdue!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn )
Newsgroups: comp.std.c
Subject: Re: Semi-reserved namespace, revisited
Message-ID: <9954@smoke.BRL.MIL>
Date: 30 Mar 89 16:54:31 GMT
References: <12209@haddock.ima.isc.com>
Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 40