Rao Shoaib wrote:

> The issue we are trying to resolve can not be solved by using types
> defined by size. Specifically we are using int64_t. On Solaris both 32
> and 64 bit this is 8 byte aligned and there are no issues. On X86 it is 
> 4 byte aligned for 32 and 8 byte for 64 bits and that is where the
> problem comes in. The documentation says int64_t is 4 byte aligned for
> X86 but 8 bytes is a multiple of 4 and so I guess the compiler is not at
> fault.
> 
> The options to solve this issue are
> 
> *) Hand construct the structure with proper padding. This could break if
> someone changes anything in the struct.
> 
> *) Use STRUCT_DECL(9F) and copy each  field.
> 
> *) Use the pragma and force the alignment.
> 
> The last option looks pretty clean and (easy :-)) and is already being
> used by SCTP so  I think it should be OK for Anders to use as well.


Just a note, the SCTP pragma was added by the AMD64 project
to deliver a 64 bit OS for x64 processor.  I believe the
pragma method was suggested by the AMD64 team to be the solution
for exactly this issue (there is a Sun internal page in the
AMD64 project explaining this).  And this usage can be found in
many kernel header files.  I don't know if there is any further
development on a better method to solve this issue.  I assume
that people who object to this use already have such a solution.
Maybe they can file a bug to fix all the kernel header files
with that better solution?

I suppose until that to be filed bug is fixed, stopping the
MIB project for this usage is not a good idea.



-- 

                                                K. Poon.
                                                [EMAIL PROTECTED]

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to