Article View: comp.lang.misc
Article #4803Re: Mesa is a dreadful language?
From: Eric Green
Date: Fri, 10 Jul 1987 06:05
Date: Fri, 10 Jul 1987 06:05
30 lines
2076 bytes
2076 bytes
in article <764@unc.cs.unc.edu>, rentsch@unc.cs.unc.edu (Tim Rentsch) says:
>> > As for type safety... Would
>> > you have us go the C route, where loophole is unnecessary because
>> > everything is an int?
>>
>> How many years has it been since you used C? Modern C is fairly strongly
>> typed, and getting more so all the time.
> On the other hand, I thought the C language definition (as opposed to
> any particular implementation) is "pointers are ints" and so forth.
> Am I wrong? (By language definition I mean K&R, of course, not any
> proposed standard.) Or are you just telling me that C compilers are
> getting better? That's a different horse altogether...
Page 102, _The C Programming Language_ by Brian W. Kernighan and Dennis M.
Ritchie, 1978 paperback addition, section 5.6:
" 5.6 Pointers are not Integers
You may notice in older C programs a rather cavalier attitude toward
copying pointers. It has generally been true that on most machines a pointer
may be assigned to an integer and back again without changing it; no scaling
or conversion takes place, and no bits are lost. Regrettably, this has led to
the taking of liberties with routins that return pointers which are then
merely passed to other routines --- the requisite pointer declarations are
often left out. For example, consider...." [goes on with a lengthy example of
a bogosity].
In other words, an int has never been a pointer, never was, never will be.
Case closed!
--
Eric Green {cbosgd,ihnp4}!killer!elg, elg@usl.CSNET
Technical Details
Message-ID:
<1120@killer.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!husc6!think!ames!lll-tis!lll-lcc!unisoft!hoptoad!academ!killer!elgReferences:
<764@unc.cs.unc.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!husc6!think!ames!lll-tis!lll-lcc!unisoft!hoptoad!academ!killer!elg From: elg@killer.UUCP (Eric Green) Newsgroups: comp.lang.misc Subject: Re: Mesa is a dreadful language? Message-ID: <1120@killer.UUCP> Date: Fri, 10-Jul-87 02:05:30 EDT Article-I.D.: killer.1120 Posted: Fri Jul 10 02:05:30 1987 Date-Received: Sun, 12-Jul-87 18:01:54 EDT References: <764@unc.cs.unc.edu> Organization: Bayou Telecommunications Lines: 30