Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: *devaddr = 0 and volatile
Message-ID: <1988Dec6.180614.23949@utzoo.uucp>
Organization: U of Toronto Zoology
References: <674@quintus.UUCP> <117@halcdc.UUCP> <468@auspex.UUCP> <13784@oberon.USC.EDU> <14832@mimsy.UUCP> <9059@smoke.BRL.MIL> <21686@apple.Apple.COM> <23706@amdcad.AMD.COM>
Date: Tue, 6 Dec 88 18:06:14 GMT

In article <23706@amdcad.AMD.COM> tim@crackle.amd.com (Tim Olson) writes:
>...the problem of unaligned accesses through a pointer to a volatile object
>which is larger than a char, but is not properly aligned...
>  What should be done here?

"Bus error -- core dumped."  :-)

More seriously, it's really not entirely clear just how strong a guarantee
of atomicity you get from X3J11's words about volatile.  I doubt that the
rules are intended to forbid pdp11 floating point, which necessarily uses
multiple accesses per object because no pdp11 has a 64-bit memory bus.
I think you have to consider volatile as meaning "no surprises" -- is
it really a surprise that a large unaligned object requires more than one
access?
-- 
SunOSish, adj:  requiring      |     Henry Spencer at U of Toronto Zoology
32-bit bug numbers.            | uunet!attcan!utzoo!henry henry@zoo.toronto.edu