[Bug c/37609] New: Pointer arithmetic yields strange result

2008-09-21 Thread john dot spelis at 3dlabs dot com
An expression using ptr arithmetic yields an unusual result unless a cast is applied; The problematic expression; MaxTimings = ((EDIDDetailed *) pExt-checksum) - pDTD; works only when cast as; MaxTimings = (((uintptr_t) pExt-checksum) - ((uintptr_t) pDTD))/sizeof(*pDTD); This occurs on

Re: [Bug c/37609] New: Pointer arithmetic yields strange result

2008-09-21 Thread Andrew Thomas Pinski
Sent from my iPhone On Sep 21, 2008, at 9:00 AM, john dot spelis at 3dlabs dot com [EMAIL PROTECTED] wrote: An expression using ptr arithmetic yields an unusual result unless a cast is applied; The problematic expression; MaxTimings = ((EDIDDetailed *) pExt-checksum) - pDTD; That is a