This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Tuesday 27 November 2012 15:29:13 Joel Brobecker wrote: > > how about this in libiberty/: > > 2012-07-31 Mike Frysinger <vapier@gentoo.org> > > > > * md5.c (md5_finish_ctx): Declare swap_bytes. Assign SWAP() output > > to swap_bytes, and then call memcpy to move it to ctx->buffer. > > As always, a quick explanation of what it fixes, and why it is > important enough that it should be included in the release would help. > Just from the ChangeLog entry alone, I am having a difficult time > evaluating it. Subject: [PATCH] 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. -mike
Attachment:
signature.asc
Description: This is a digitally signed message part.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |