[
https://issues.apache.org/jira/browse/TS-378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Leif Hedstrom resolved TS-378.
------------------------------
Resolution: Duplicate
Fix Version/s: (was: 3.3.3)
marking this as duplicate of TS-302, which has some further details.
> 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
>
> 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
For more information on JIRA, see: http://www.atlassian.com/software/jira