Xref: utzoo comp.compilers:1907 comp.lang.c:38224 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!world!iecc!compilers-sender From: pardo@june.cs.washington.edu (David Keppel) Newsgroups: comp.compilers,comp.lang.c Subject: Re: Borland Turbo C 2.0 for Atari 68000 machines: ODD behavior Keywords: C, code, question Message-ID: <1991Apr12.205721.16026@beaver.cs.washington.edu> Date: 12 Apr 91 20:57:21 GMT References: <1991Apr6.091013.26131@daffy.cs.wisc.edu> Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: pardo@june.cs.washington.edu (David Keppel) Followup-To: comp.lang.c,comp.sys.m68k Organization: Computer Science & Engineering, U. of Washington, Seattle Lines: 25 Approved: compilers@iecc.cambridge.ma.us carter@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@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.