tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

>> To be type-correct, the various structs sockaddr_* really need to be
>> a single discriminated union...and I'm not sure sockaddr_un can ever
>> be done type-correctly; I'd have to think about it more.)
> GCC's transparent unions are really nice for this.

Yes, though all they do is remove an otherwise-necessary layer of
member naming.  The part that I'd really find irritating is having to
allocate the whole union - roughly the equivalent of today's struct
sockaddr_storage - even when I know it's going to hold only one flavour
of sockaddr, which wastes most of the space allocated.  (The space
wasted is small enough to be most cases.)

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index