This is the mail archive of the
src-cvs@sourceware.org
mailing list .
src/libiberty ChangeLog md5.c
- From: vapier at sourceware dot org
- To: src-cvs at sourceware dot org
- Date: 31 Jul 2012 09:02:35 -0000
- Subject: src/libiberty ChangeLog md5.c
CVSROOT: /cvs/src
Module name: src
Changes by: vapier@sourceware.org 2012-07-31 09:02:35
Modified files:
libiberty : ChangeLog md5.c
Log message:
libiberty/md5: fix strict alias warnings
Current libiberty md5 code triggers these warnings with gcc-4.7.1 for me:
libiberty/md5.c: In function �md5_finish_ctx�:
libiberty/md5.c:117:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
libiberty/md5.c:118:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
The change below fixes things for me. The optimized output (-O2) is the same
before/after my change on x86_64-linux. I imagine it'll be the same for most
targets. It seems simpler than using a union on the md5_ctx buffer since these
are the only two locations in the code where this occurs.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/libiberty/ChangeLog.diff?cvsroot=src&r1=1.611&r2=1.612
http://sourceware.org/cgi-bin/cvsweb.cgi/src/libiberty/md5.c.diff?cvsroot=src&r1=1.12&r2=1.13