Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!ima!ISM780B!jim
From: jim@ISM780B.UUCP
Newsgroups: net.lang.c
Subject: Re: SIZEOF
Message-ID: <136@ISM780B.UUCP>
Date: Mon, 21-Jan-85 00:28:45 EST
Article-I.D.: ISM780B.136
Posted: Mon Jan 21 00:28:45 1985
Date-Received: Tue, 22-Jan-85 05:24:55 EST
Lines: 32
Nf-ID: #R:brl-tgr:-752700:ISM780B:25500096:000:1637
Nf-From: ISM780B!jim    Jan 20 09:52:00 1985

> K&R page 192 first paragraph:
>
>   "The compilers currently allow a pointer to be assigned to an integer,
>an integer to a pointer, and a pointer to a pointer of another type.
>THE ASSIGNMENT IS A PURE COPY OPERATION, WITH NO CONVERSION. This usage is
>nonportable, and may produce pointers which cause addressing exceptions
>when used. However, it is guaranteed that the assignment of the constant
>0 to a pointer will produce a null pointer distinguishable from a pointer
>to any object."

K&R is obsolete!  K&R is obsolete!  K&R is obsolete!  K&R is obsolete!
K&R is obsolete!  K&R is obsolete!  K&R is obsolete!  K&R is obsolete!
K&R is obsolete!  K&R is obsolete!  K&R is obsolete!  K&R is obsolete!

It is old, it is outdated, it is wrong.
Those compilers that allow structure assignment, separate name spaces
for structure members, and enums, that is, the compilers that implement
the real C language, the one described by the C reference manual that
AT&T distributes, and the one on which the ANSI standard is being based,
generate a warning when such assignments occur.  The C reference manual
does not allow them; values must be explicitly cast before being assigned.

>This says to me that the sizes must be the same. Changing the size is
>a conversion in my eye.

Have you seen an ophthalmologist lately?  :-)
Even given K&R, with its cavalier approach toward formal specification,
this is not a reasonable interpretation, because the above paragraph says
"integer", not "int", and a pointer can't be the same size as a char,
a short, an int, and a long all at the same time.

-- Jim Balter, INTERACTIVE Systems (ima!jim)