Path: utzoo!news-server.csri.toronto.edu!rutgers!apple!decwrl!uunet!world!ksr!jfw From: jfw@ksr.com (John F. Woods) Newsgroups: comp.lang.c Subject: Re: Portability vs. Endianness Message-ID: <2670@ksr.com> Date: 13 Mar 91 19:41:55 GMT References: <1991Mar12.105451.19488@dit.upm.es> <2628@ksr.com> <15457@smoke.brl.mil> <2669@ksr.com> Sender: news@ksr.com Lines: 13 jfw@ksr.com (John F. Woods) writes: >[One more time, this time with an open copy of ANSI C] Now, opening the FIRST chapter, ... >Further hmm. Is memcpy() obliged to do anything sensible if handed >a pointer to an integer cast to a void *? Yes. Courtesy of section 1.6 and explained by some handwaving in the Rationale, all C objects can be addressed as arrays of characters. Of course, on a 1s-complement machine, the characters you find in a long will NOT be the same characters you would find on a 2s-complement machine, so as long as the declaration of 'var' in the original stays just 'long', then memcpy() isn't the right answer.