Borland Turbo C 2.0 for Atari 68000 machines: ODD behavior
David Keppel
pardo at june.cs.washington.edu
Sat Apr 13 06:57:21 AEST 1991
carter at cs.wisc.edu (Gregory Carter) writes:
> (unsigned int)(*((unsigned int *)0xffff8e20L)) = 0x03;
>translates to:
> MOVE.W #$0003, $8e20
>This is obviously not correct.
I'll agree that it isn't what I *expected* but it is *correct*.
Here are some other correct implementations:
* Compiler refuses to compile the program
* Program aborts when executed
* Program runs `rogue'
* Program assigs 3 to memory location 0xffff8e20
Remember, dereferencing a hard-coded address (in C) has
implementation-defined effect.
In the meanwhile, I agree that the one it chose is non-intuitive.
Followups to `comp.lang.c' and `comp.sys.m68k'.
;-D on ( Paid-up in tuition ) Pardo
--
Send compilers articles to compilers at iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
More information about the Comp.lang.c
mailing list