[ https://issues.apache.org/jira/browse/TS-378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leif Hedstrom updated TS-378: ----------------------------- Fix Version/s: (was: 3.1.6) 3.3.0 Moving out to v3.3.0, move back to 3.1.4 if this will be work on *soon*. > FIx the strict-aliasing rules warnings > -------------------------------------- > > Key: TS-378 > URL: https://issues.apache.org/jira/browse/TS-378 > Project: Traffic Server > Issue Type: Improvement > Components: Cleanup > Affects Versions: 3.0.0 > Reporter: Mladen Turk > Assignee: Mladen Turk > Priority: Minor > Fix For: 3.3.0 > > > Currently the compile fails with -fstrict-aliasing. > The reason is mostly using int pointers to read or write 64 bit numbers > Eg. INK_MD5.cc has > struct INK_MD5 > { > uint64 b[2]; > uint32 word(int i) > { > uint32 *p = (uint32 *) & b[0]; > return p[i]; > } > ... > }; > Such things can be easily fixed and properly handled using unions > (they are invented for that) > struct INK_MD5 > { > union { > uint64 q[2]; > uint32 u[4]; > unsigned char b[16]; > } s; > uint32 word(int i) > { > return s.w[i]; > } > ... > }; -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira