src/libiberty ChangeLog md5.c

vapier@sourceware.org vapier@sourceware.org
Wed Nov 28 20:00:00 GMT 2012


CVSROOT:	/cvs/src
Module name:	src
Branch: 	gdb_7_5-branch
Changes by:	vapier@sourceware.org	2012-11-28 20:00:48

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.
	
	(cherry picked from current cvs HEAD)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/libiberty/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=1.609&r2=1.609.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/libiberty/md5.c.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=1.12&r2=1.12.4.1



More information about the Src-cvs mailing list