🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #13307

Re: __chip is evil

#13307
From: Peter da Silva
Date: Fri, 12 Jan 1990 14:46
49 lines
2408 bytes
[ to comp.std.c folks: the discussion is the use of __id for nonportable
  qualifiers in declarations, like Microsoft does with __far. ]

> >Names beginning with two underscores or one underscore and an uppercase
> >letter are reserved to the implementation and may be used for any purpose
> >the implementer desires. Names beginning with one underscore and anything
> >but an uppercase letter may be used with file scope, but as externals are
> >reserved to the implementation.

> Section 4.1.2 of (my draft of) the ANSI standard states that "All external 
> identifiers that begin with an underscore and iether an upper-case letter
> or another underscore are reserved."  However, this simply means that these
> identifiers may be defined in standard header files, so the user should not
> use these names.

What it means is that a portable C program will not use those names for
any purpose. So it's safe to use them for a non-portable extension to the
language, because you will not break any portable programs.

> The standard does NOT say that the implementor may use these 
> identifiers to change the syntax of the C language, as you are doing when you
> introduce things like "__chip".  

And it doesn't say the implementor can't do this either.

In practice it means it's guaranteed to be safe to use them for
this purpose.

> >On the other hand #pragma is not allowed to change the semantics of a
> >program.

> I'm sorry, but I can't find this in the standard.  Can you direct me to 
> the appropriate paragraph?

Anyone in comp.std.c want to take a crack at it? It certainly gets brought
up often enough over there...

Certainly #pragma is a lot less elegant:

	static __chip ushort icon[4+ISIZE];

Or:

	#pragma chip(icon)
	static ushort icon[4+ISIZE];
-- 
Peter "Have you hugged your wolf today" da Silva <peter@sugar.hackercorp.com>
`-_-'
 'U`  "I haven't lost my mind, it's backed up on tape somewhere"
Technical Details
Message-ID: <4919@sugar.hackercorp.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!texbell!sugar!peter
References: <85006@linus.UUCP> <4839@sugar.hackercorp.com> <86113@linus.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!texbell!sugar!peter
From: peter@sugar.hackercorp.com (Peter da Silva)
Newsgroups: comp.sys.amiga.tech,comp.std.c
Subject: Re: __chip is evil
Message-ID: <4919@sugar.hackercorp.com>
Date: 12 Jan 90 14:46:05 GMT
References: <85006@linus.UUCP> <4839@sugar.hackercorp.com> <86113@linus.UUCP>
Reply-To: peter@sugar.hackercorp.com (Peter da Silva)
Organization: Sugar Land Unix - Houston
Lines: 49