Path: utzoo!attcan!uunet!mcsun!ukc!tcdcs!swift.cs.tcd.ie!maths.tcd.ie!tim From: tim@maths.tcd.ie (Timothy Murphy) Newsgroups: comp.std.c Subject: memcpy Summary: memcpy -- differences in interpretation Keywords: memcpy Message-ID: <1990Sep19.021418.11574@maths.tcd.ie> Date: 19 Sep 90 02:14:18 GMT Organization: Dept. of Maths, Trinity College, Dublin, Ireland. Lines: 21 Recently, while debugging the Unix version of unzip.c, I found a surprising discrepancy between 'memcpy' on various machines. In unzip.c it is assumed that the effect of buf[0] = c; memcpy(buf+1, buf, 20); is to set buf[0] = buf[1] = buf[2] = ... = buf[21] = c. This is indeed the effect with most compilers I tried -- rather surprisingly, to me -- but not with cc on the Sun SparcStation (sun4). Is this a bug on the Sparc, or is memcpy not fully specified? -- Timothy Murphy e-mail: tim@maths.tcd.ie