🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #4827

Re: Names of non-local objects

#4827
From: Ron Natalie
Date: Mon, 03 Aug 1987 21:07
35 lines
1761 bytes
The main reason that people use underline prepending in compilers is
that the compilers output to assembler as an intermediate and they
did not want to check (or wished to always be consistant) for ambiguities
of the following nature:

	int	R6;

	R6 = 3;

   Yields in PDP-11 assembler...

	mov #3, R6

which without underscore prepending means move 3 to the stack pointer
which is not what the C code implies.  The ORACLE IBM 370 C compiler
among its multitude of other bugs had this problem.

SUGGESTION:

What you really want to be able to do is to tag certain C symbols with
other names when they get assembled or linked.  This allows you to use
C to reference symbols whose names are not legal C identifiers (like
they have funny symbols in them like $ or %).  Since doing this is
going to be implementation specific to begin with, you can have a
feature in C (perhaps associated with the ANSI pragma construct) that
binds a C name to an external name in the source code,

    #pragma bind sys_zark   "sys$ZARK"

Of course, it probably can also be done in existing compilers by some
post processing on the output of the compiler to change the symbol names.

-Ron

    
Technical Details
Message-ID: <13675@topaz.rutgers.edu>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!rutgers!topaz.rutgers.edu!ron
References: <557@l.cc.purdue.edu>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!rutgers!topaz.rutgers.edu!ron
From: ron@topaz.rutgers.edu (Ron Natalie)
Newsgroups: comp.lang.misc,comp.lang.c,comp.lang.fortran,comp.lang.pascal
Subject: Re: Names of non-local objects
Message-ID: <13675@topaz.rutgers.edu>
Date: Mon, 3-Aug-87 17:07:32 EDT
Article-I.D.: topaz.13675
Posted: Mon Aug  3 17:07:32 1987
Date-Received: Tue, 4-Aug-87 05:15:41 EDT
References: <557@l.cc.purdue.edu>
Organization: Rutgers Univ., New Brunswick, N.J.
Lines: 35