From: SourceForge.net <no...@so...> - 2004-01-28 00:32:12
|
Bugs item #885903, was opened at 2004-01-28 00:32 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=885903&group_id=2435 Category: gcc Group: Known bugs Status: Open Resolution: None Priority: 5 Submitted By: william (pwmingw) Assigned to: Danny Smith (dannysmith) Summary: Am I crazy? Initial Comment: /* 2004-01-28 test.c windows xp gcc 3.2.3 ld 2.13.90 mingw-3.1.0-1.exe */ #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { size_t *s1; size_t *s2; s1 = (size_t *)calloc(4, sizeof(size_t)); s2 = (size_t *)calloc(4, sizeof(size_t)); s2[0] = 1; s2[1] = 2; s2[2] = 3; s2[3] = 4; memcpy(s1, s2, 4); printf("%u ", s1[0]); // it's ok! printf("%u ", s1[1]); // wrong value printf("%u ", s1[2]); // wrong value printf("%u\n", s1[3]); // wrong value system("pause"); return EXIT_SUCCESS; } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=885903&group_id=2435 |