From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,984d86061641e750 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1990-01-29 06:39:41 PST Path: gmdzi!unido!mcsun!uunet!lll-winken!decwrl!shlump.nac.dec.com!mountn.dec.com!minow From: minow@mountn.dec.com (Martin Minow) Newsgroups: comp.sys.dec Subject: Re: DEC compilers under Ultrix Message-ID: <1303@mountn.dec.com> Date: 29 Jan 90 14:39:41 GMT References: <656@umvlsi.ecs.umass.edu> <1611@atha.AthabascaU.CA> Reply-To: minow@thundr.enet.dec.com (Martin Minow) Organization: Digital Equipment Corporation Posted: Mon Jan 29 15:39:41 1990 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.