Dear "Reinhard Meyer (-VC)",
In message <[email protected]> you wrote:
>
> Instead of:
> static unsigned char buffer[ENC_MAX_FRM_LEN];
> The following works fine:
> static unsigned long lbuffer[ENC_MAX_FRM_LEN/4];
> #define buffer ((unsigned char *)lbuffer)
>
> Is there a more elegant way of forcing a char array to start
> on an even address?
Sure. Use something like
static unsigned char buffer[ENC_MAX_FRM_LEN] __attribute__
((aligned(4)));
Or, probably even better, use malloc() to allocate the buffer.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
It is impractical for the standard to attempt to constrain the
behavior of code that does not obey the constraints of the standard.
- Doug Gwyn
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot