At 03:46 AM 3/31/06 +0000, dsidlauskas1 wrote:
>Jaya,
>
>The "vanilla" cast is only to be treated as a byte packed cast if the
>object that is being cast is itself byte packed.
>
>In thinking about my original case, the compiler should at least warn
>since, with;
>
>char buf[]={...};
>int *ip;
>
>ip = (int *)&buf[i];
>
>the left and right side of this assignment are not of the same type,
>even though the declaration would have you think so. ip is a pointer
>to a default word aligned object, and (int *)&buf[i] is a pointer to a
>byte aligned object. These are really not the same data types.
Sure they are the same type, you told the compiler they were the same
type. It went away assuming that you knew what you were talking
about. Silly compiler ;)
Robert
" 'Freedom' has no meaning of itself. There are always restrictions, be
they legal, genetic, or physical. If you don't believe me, try to chew a
radio signal. " -- Kelvin Throop, III
http://www.aeolusdevelopment.com/Message
Re: [lpc2000] Re: For C Experts
2006-03-31 by Robert Adsett
Attachments
- No local attachments were found for this message.