call to revolt

Henry Spencer henry at zoo.toronto.edu
Wed Jun 26 04:19:16 AEST 1991


In article <rabson.677868220 at physics.ubc.ca> rabson at physics.ubc.ca (David Rabson) writes:
>Outlawing lvalue casts, however, borders on fascism.  I have yet to see
>a pre-ansi compiler that fails to treat properly
>
>		void *thing;
>		((int *)thing)++;

What do you mean by "treat properly"?  What does this construct *mean*?
Remember that `void *' and `int *' need not even be the same size, much
less have the same representation.  A cast is a conversion operation,
not a "view these bits differently" operation.  (See K&R1 page 42.)

>The rest of us should stop sitting back and start fighting.  If enough
>customers insist on casting lvalues and otherwising ignoring ansi's
>meddling in Kernighan's and Ritchie's work, vendors will create
>correct, rather than compliant, compilers.

Please cite K&R chapter and verse for thinking that casts are lvalues.

You might also want to note that Dennis Ritchie has stated openly:
"I think X3J11 did an excellent job, though there are legitimate criticisms".
(Article <10039 at alice.uucp>, 21 Oct 1989.)
-- 
"We're thinking about upgrading from    | Henry Spencer @ U of Toronto Zoology
SunOS 4.1.1 to SunOS 3.5."              |  henry at zoo.toronto.edu  utzoo!henry



More information about the Comp.std.c mailing list