From owner-freebsd-current Tue May 9 18:47:31 2000 Delivered-To: freebsd-current@freebsd.org Received: from sendero.simon-shapiro.org (sendero.simon-shapiro.org [207.69.194.51]) by hub.freebsd.org (Postfix) with SMTP id 9A3C537B5BF for ; Tue, 9 May 2000 18:47:27 -0700 (PDT) (envelope-from shimon@simon-shapiro.org) Received: (qmail 99919 invoked from network); 10 May 2000 02:38:59 -0000 Received: from nomis.simon-shapiro.org (209.86.126.163) by sendero.simon-shapiro.org with SMTP; 10 May 2000 02:38:59 -0000 Content-Length: 1170 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3918A802.A420EC76@cup.hp.com> Date: Tue, 09 May 2000 21:50:09 -0400 (EDT) Reply-To: shimon@simon-shapiro.org Organization: Simon's Garage From: Simon Shapiro To: Marcel Moolenaar Subject: Re: One more question (different now) Cc: freebsd-current@FreeBSD.ORG, obrien@FreeBSD.ORG, Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 10-May-00 Marcel Moolenaar wrote: > Mike Smith wrote: >> >> Ugh. I don't actually like that, because it serves a valid purpose. >> What irritates me mostly is just that there is no way of casting a >> volatile object into a non-volatile type, so you can't implement any sort >> of conditional volatility exclusion. > > You can however use a union and have a non-volatile object aliasing a > volatile object as in: > > union u { > volatile int vi; > int nvi; > }; And you know for a fact that the compiler will generate the right code. Right? :-) Even if it did, I feel nervous. What if, in the example above, the generated code does not clear the structure on time, as indicated? What about other cases where references to volatile data are being made? Thanx for the tip, though...! > > -- > Marcel Moolenaar > mail: marcel@cup.hp.com / marcel@FreeBSD.org > tel: (408) 447-4222 > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message Sincerely Yours 404.664.6401 Simon Shapiro Research Fellow, Earthlink Inc. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message