On 12/21/06, James Carlson <[EMAIL PROTECTED]> wrote:
Cyril Plisko writes:
> On 12/1/06, James Carlson <[EMAIL PROTECTED]> wrote:
> >
> > It's an internal implementation detail of that header file.  Source
> > code in ON should be using __NORETURN, __PURE, and so on.
>
> Shouldn't there be __PACK as well ?

__PACK is pretty evil, in my opinion.  It papers over alignment issues
that are rather significant in otherwise portable applications.


Agree with you 100% here. However, sometimes your choices
are very limited due to compatibility requirements and such.

Anyway, it is not about whether packing is good or bad. It is about
what you type - "__attribute__ ((__pack__))" or "__sun_attr___packed__"
or "__PACKED" in case you have to. Similar to other cases in the
header file in hand.

I'd much rather see such structures defined using natural alignments
(uchar_t arrays, if necessary) along with accessor functions or macros
to handle the unaligned bits.

It's not as though it's an issue that happens often in well-designed
protocols.

--
James Carlson, KISS Network                    <[EMAIL PROTECTED]>
Sun Microsystems / 1 Network Drive         71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677



--
Regards,
       Cyril
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to