Re: structure size and structure element offset calculation issue

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

 



On Mon, May 26, 2014 at 10:31 PM, Sivaprasad
<sivaprasad.pv@xxxxxxxxxxxxxxxxxx> wrote:
>
> By packing the structure, issue got solved but generating more code.
> How can I make our cross compiler to generate size of struct { short s;} as
> 2 instead of 4 ?

This is not quite the question you asked last time.  I would expect
that sizeof(struct{short s;}) would return 2.  It does on x86.

> Is it required to change any macro's in port.h?

If for your private port sizeof(struct{short s;}) does not return 2
(and assuming that sizeof(short) does return 2), then, yes, you can
change something in your private port to fix that.  It's not the
default case, so it would be something unusual that your port is
doing.  For example, perhaps you have defined ADJUST_FIELD_ALIGN.

Ian




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux