Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RE: [lpc2000] Re: For C Experts

2006-03-31 by Paul Curtis

Hi, 

> Since the compiler knows that buf is a byte aligned object, 
> woutldn't it be resonable for the compiler to treat
> 
> (int *)&buf[i]
> 
> as 
> 
> (__packed int *)&buf[i]
> 
> In general, if non-naturaly aligned objects are promoted by a 
> cast, shouldn't, by default, the cast be of the proper 
> non-aligned type?

Bloody hell no.  Insanity.

--
Paul Curtis, Rowley Associates Ltd   http://www.rowley.co.uk 
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.