#5 Fix void* cast to uint32_t in 'ShinyManager.c' GNUC

closed-accepted
nobody
None
7
2013-03-27
2013-02-28
Maxi
No

There is a warning (gcc) resp. error (g++) in file 'ShinyManager.c'. You should change line 94 from:
uint32_t a = (uint32_t) a_pParent + (uint32_t) a_pZone;
to:
uint32_t a = (uintptr_t) a_pParent + (uintptr_t) a_pZone;

The size of void* is different in 32 and 64 bit systems so the compiler reports a warning (gcc) resp. even an error (with g++) on 64bit systems. To avoid truble you should just cast the void* to a pointer type which supports the arithmetic operation and then cast it to your desired 32bit index value. The rest of the file can remain unchainged because the pointers are never used again to reference any memory address.

Discussion

  • Maxi
    Maxi
    2013-02-28

    revised 'ShinyManager.c'

     
    Attachments
  • Maxi
    Maxi
    2013-02-28

    • priority: 5 --> 7
     
  • Maxi
    Maxi
    2013-03-01

    Applies to revision 39 (currently latest)

     
  • Maxi
    Maxi
    2013-03-27

    • status: open --> closed-accepted