Re: Unexpected unaligned access on arm

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

 



On Mon, Jun 08, 2020 at 10:49:22PM +0900, Oleg Endo wrote:
> On Mon, 2020-06-08 at 15:34 +0200, Lars Poeschel wrote:
> > 
> > What am I missing ? What am I doing wrong ?
> > 
> 
> You're casting an address of some byte array to a point to struct,
> which has an alignment > 1 byte.  Try adding a #pragma pack (1) or
> respective attribute.

Thank you! The pragma does indeed the right thing. gcc now produces
code, that accesses the fields in question individually.
But shouldn't the option
-mno-unaligned-access
I use for compiling also do the same ? Why is this not working ?

Thanks again,
Lars



[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