Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: minow@mountn.dec.com (Martin Minow)
Subject: Re: DEC compilers under Ultrix
Date: 29 Jan 90 14:39:41 GMT	[thread overview]
Message-ID: <1303@mountn.dec.com> (raw)
In-Reply-To: 1611@atha.AthabascaU.CA

In article <1611@atha.AthabascaU.CA> rwa@cs.AthabascaU.CA (Ross Alexander)
writes:
> I have seen code containing
>	int * ip;
>	ip = & 2;
>compile on VMS...  reminds me of B rather than C.  Rvalues don't
>have lvalues in the real world.

This was an extension to the C language that simplified system-level
programming in VMS.  Many VMS operating system routines (routines
that would be in section 2 on Unix) take arguments that are the address
a value.  In many circumstances, the argument would be a constant.
Allowing constants to be passed by address permits

	static int system_mumble = SYSTEM_MUMBLE;
	... sys$function( ... &system_mumble) ...

to be written sys$function(... &SYSTEM_MUMBLE).  I believe the compiler
doesn't permit you to write (&2 = foo), and could potentially store the
constant in a read-only area (I haven't checked that this is the case,
and haven't needed to, as it were).

The Vax C folk are very aware that this is an extension to the "standard"
K&R definition.  It predates the Ansi committee by about 5 years.  It
makes life much easier for folk programming on VMS.  You don't have to
use it.

Martin Minow
minow@thundr.enet.dec.com
The above does not represent the position of Digital Equipment Corporation.


      reply	other threads:[~1990-01-29 14:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-01-26 20:32 DEC compilers under Ultrix Satish Kumar .C
1990-01-28  3:31 ` Ross Alexander
1990-01-29 14:39   ` Martin Minow [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox