This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unaligned attribute


On Thu, Mar 20, 2008 at 04:27:42PM +0100, Jan Hoogerbrugge wrote:
> Hi,
> 
> I am looking for a way to specify that data is not aligned and that therefore
> word accesses should be expanded into byte accesses. For example:
> 
> void f(__unaligned int *a)
> {
>   *a = 0;
> }
> 
> Expands into 4 byte stores. Any suggestions on how to implement this?

Try __attribute__((__packed__))?

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]