------- Comment #1 from davids at webmaster dot com 2008-03-28 09:24 ------- #include <string.h> int moo(void) { unsigned char msg1[] = { 0, 0 }; unsigned char msg2[] = { 0, 0 }; memcpy(msg1, msg2, 2); return memcmp(msg1, msg2, 2) != 0; }
With this code, changing the sizes in both memcpy and memcmp from '2' to '1' makes the problem go away. So does changing both arrays from '{ 0, 0 }' to { 0, 0, 0 }'. So maybe it's an off-by-one? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35730