Borland Turbo C 2.0 for Atari 68000 machines: ODD behavior

Chris Torek torek at elf.ee.lbl.gov
Sat Apr 20 05:33:20 AEST 1991


[  (unsigned int)(*((unsigned int *)0xffff8e20L)) = 0x03;  ]

In article <1991Apr19.172024.10364 at cbnewsj.att.com> asd at cbnewsj.att.com
(Adam S. Denton) writes:
>This debate is apparently what assigning to a casted expression should do.

Actually, the original debate ignored the illegal source and concentrated
on the questionable (depends-on-sign-extension) object code.

The above is very clearly
>    (cast) [something] = [some value];
>which has never been defined to have any meaning whatsoever.

Actually, it is defined far enough to require a diagnostic from an ANSI
conformant compiler (after which all bets are off).  (This is another
example I would not expect to find in a book on `how to use ANSI C',
and illustrates why such a book is not good for `knowing the ANSI
standard'.  It is also an example of why `knowing the standard' is
often unnecessary: it suffices to know `the result of a cast is a
value, not an object, and may not be modified' without knowing just
what is required of, and allowed of, a compiler when it is handed such
an expression.)
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427)
Berkeley, CA		Domain:	torek at ee.lbl.gov



More information about the Comp.lang.c mailing list