Subject: Re: Question
To: Todd Vierling <tv@pobox.com>
From: Matthew Jacob <mjacob@feral.com>
List: port-alpha
Date: 12/10/1998 08:00:48
Oh, why do we always go through this..... If you have a device that
imposes some byte and bit position specific protocol, you cannot assume
that you can coerce a C structure to it *anyway*- you may get lucky for
platform #N, but if you're writing portable code you should also include
macroized or inlined (de)canonicalization functions. 

On Thu, 10 Dec 1998, Todd Vierling wrote:

> On Thu, 10 Dec 1998, Lennart Augustsson wrote:
> 
> : Well, Jason, this probably explains why USB doesn't work on the
> : Alpha.  There are lots of USB descriptors structs that I don't
> : align because that's how the device delivers them (i.e. as one
> : big chunk of descriptors, all concatenated).  I'll have to figure
> : out what the nicest way to handle it is.
> 
> Hmmm... I wonder if __attribute__((packed)) will do what you want.  Not that
> it's a good solution, by any means... it's probably going to hit performance
> in a big way.  The correct solution is, of course, to align *everything* -
> especially if you ever want to see USB on a sparc-line box via a PCI-to-USB
> interface or somesuch.
> 
> -- 
> -- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)
>