Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Jul 2001 23:07:31 -0700
From:      Mike Smith <msmith@freebsd.org>
To:        Jens Schweikhardt <schweikh@schweikhardt.net>
Cc:        Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/sys bio.h 
Message-ID:  <200107050607.f6567Vx00615@mass.dis.org>
In-Reply-To: Your message of "Wed, 04 Jul 2001 21:26:24 %2B0200." <20010704212624.A1812@schweikhardt.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> On Tue, Jul 03, 2001 at 11:33:21PM +0200, Joerg Wunsch wrote:
> # As Mike Smith wrote:
> ...
> # > > Also, using a void * would have complicated matters pretty much.  It's
> # > > invalid to abuse a void * as an int
> # > 
> # > Er, no it's not.
> # > 
> # > 	void *foo;
> # > 	int bar;
> # > 
> # > 	bar = (int)(uintptr_t)foo;
> # > 
> # > 	foo = (void *)(uintptr_t)bar;
> # 
> # I think that's wrong C.  AFAIR, an arbitrary /pointer/ is allowed to
> # be cast to a void *, and then cast back to just that arbitrary
> 
> s/cast/assigned to/g void pointers exist to fill^Wopen a gap in the type
> system. Casting pointers to and from void* is a silly thing to do
> outside variable arg lists (and only done by the C++ infected where it
> is rquired :-)

Regardless, the above is both legal and desirable.  uintptr_t is an 
arbitrary scalar type large enough to hold both an unsigned integer and a 
pointer on the platform.

Most of the rest of the drivel you offer up is laughable, given that 
you're writing a floppy disk driver, for crying out loud.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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