🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: __chip is evil

#13215
From: Peter da Silva
Date: Thu, 28 Dec 1989 15:48
38 lines
1979 bytes
In article <85006@linus.UUCP> duncant@mbunix.mitre.org (Thomson) writes:
> Those (misguided) individuals in favor of keywords such as __chip
> should check the ANSI standard.

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.

Examples discussed on the net have included new keywords (__near, __far, etc),
as well as more mundane things like hiding library routines (_write) and stuff
in headers (_IOB). Programs that USE them are not portable programs, but the
semantics being discussed are machine specific anyway.

On the other hand #pragma is not allowed to change the semantics of a program.
A compiler is free to ignore any #pragma so long as the semantics of the
resulting program are retained. #pragma CHIP(whatever) doesn't fulfill this
restriction.

Examples of legal pragmas include:

#pragma line(45)
#pragma list(on)
#pragma builtin(strcpy)

so long as the builtin version is identical to the subroutine.

Interestingly enough, the latter can also be achieved by using reserved
keywords:

#define strcpy _BUILTIN_strcpy

has been brought up as an example.
-- 
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: <4839@sugar.hackercorp.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!lavaca.uh.edu!uhnix1!sugar!peter
References: <85006@linus.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!lavaca.uh.edu!uhnix1!sugar!peter
From: peter@sugar.hackercorp.com (Peter da Silva)
Newsgroups: comp.sys.amiga.tech
Subject: Re: __chip is evil
Message-ID: <4839@sugar.hackercorp.com>
Date: 28 Dec 89 15:48:09 GMT
References: <85006@linus.UUCP>
Reply-To: peter@sugar.hackercorp.com (Peter da Silva)
Organization: Sugar Land Unix - Houston
Lines: 38