Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 May 2000 21:50:09 -0400 (EDT)
From:      Simon Shapiro <shimon@simon-shapiro.org>
To:        Marcel Moolenaar <marcel@cup.hp.com>
Cc:        freebsd-current@FreeBSD.ORG, obrien@FreeBSD.ORG, Mike Smith <msmith@FreeBSD.ORG>
Subject:   Re: One more question (different now)
Message-ID:  <XFMail.000509215009.shimon@simon-shapiro.org>
In-Reply-To: <3918A802.A420EC76@cup.hp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.000509215009.shimon>