Yahoo Groups archive

Lpc2000

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

Message

Re: [lpc2000] Re: For C Experts

2006-03-31 by Robert Adsett

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/

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.