Menu

#81 Fix aliasing

closed-fixed
nobody
None
5
2011-10-11
2010-09-21
No

The "*(uint32_t *)&" trick breaks strict aliasing C rules, making gcc complain. The patch uses memcpy to avoid it.

Probably the memcpy could be done directly to the final destination, but the maze of macros makes it difficult to see for me. Perhaps the compiler will optimize the local variable anyway...

Discussion

  • Cristian Morales Vega

     
  • Ulrich Klauer

    Ulrich Klauer - 2011-10-11
    • status: open --> closed-fixed
     
  • Ulrich Klauer

    Ulrich Klauer - 2011-10-11

    An equivalent solution was implemented in March (commit 2d5b2941), thus closing this item.

     

Log in to post a comment.