[ 
https://issues.apache.org/jira/browse/THRIFT-1057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Christian Lavoie resolved THRIFT-1057.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.7
         Assignee: Christian Lavoie

Committed revision 1068672. Thanks for the patch!

> casts in TBinaryProtocol.tcc causing "dereferencing type-punned pointer will 
> break strict-aliasing rules" warnings from gcc 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1057
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1057
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.7
>            Reporter: Chris Morgan
>            Assignee: Christian Lavoie
>             Fix For: 0.7
>
>         Attachments: fix_strict_aliasing_warning.patch
>
>
> Code is doing things like:
> {code}
> uint8_t b[2];
> uint16_t val;
> val = *(int16_t*)b;
> {code}
> Due to aliasing there isn't a guarantee that b[] will be placed on a 16 bit 
> boundary.
> Fix is to use unions to ensure alignment. Patch attached.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to