Subject: Re: CVS commit: basesrc/usr.bin/file
To: None <>
From: Greg A. Woods <>
List: tech-userlevel
Date: 06/06/2002 18:00:20
[ On Thursday, June 6, 2002 at 14:21:09 (-0400), der Mouse wrote: ]
> Subject: Re: CVS commit: basesrc/usr.bin/file
> >> Except that it is very useful to be able to use structures to map
> >> over device register sets.
> > It might be "useful" to you, but it's just flat out wrong for
> > portable code, especially of course if you're using bitfields,
> [...]
> > 	#define offsetof(type,memb) ((size_t)&((type *)0)->memb)
> > They do go on to warn that an implementation need not permit such use
> > of the null pointer constant in that fashion, but I've never
> > encountered a compiler implementation that disallowed it.....
> Does anyone else see the irony of these being juxtaposed in the same
> message?

I'm not sure I do....  I was referring to non-Unix compilers i've used
in the past too, BTW.

>  Especially since "map[ping] over device register[s]" is
> approximately the last place you have to worry about portability to
> every compiler on the planet?

That's certainly not true for NetBSD's kernel source tree.  There are
many device drivers which are portable between computers and which
presumably should be maintained in such a way that they're also portable
between compilers (though the GCC love-in in this thread has me saddened)

								Greg A. Woods

+1 416 218-0098;  <>;  <>;  <>
Planix, Inc. <>; VE3TCP; Secrets of the Weird <>