Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 May 2000 03:08:02 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Doug Rabson <dfr@nlsystems.com>
Cc:        Mike Smith <msmith@FreeBSD.ORG>, obrien@FreeBSD.ORG, freebsd-current@FreeBSD.ORG
Subject:   Re: One more question (different now) 
Message-ID:  <Pine.BSF.4.21.0005110258090.10206-100000@besplex.bde.org>
In-Reply-To: <Pine.BSF.4.21.0005100910590.47945-100000@salmon.nlsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 10 May 2000, Doug Rabson wrote:

> You can suppress the warning if you cast to uintptr_t first. Pretty ugly
> though.

For (almost) full uglyness and correctness, you have to cast to
"volatile void *" first, then back via "void *":

#define	unvolstructfoop(sfp) \
    ((struct foo *)(void *)(uintptr_t)(volatile void *)(sfp))

For full uglyness, add an ifdef to test if uintptr_t exists (see the C99
standard), and backup methods for when it doesn't exist.

Bruce



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?Pine.BSF.4.21.0005110258090.10206-100000>