Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!brl-adm!brl-smoke!smoke!gwyn@BRL.ARPA From: gwyn@BRL.ARPA (VLD/VMB) Newsgroups: net.lang.c Subject: Re: Failure of \"long x(cp) char * cp; { return *((long *) cp); }\" is a bug? Message-ID: <1808@brl-smoke.ARPA> Date: Sun, 29-Jun-86 14:43:08 EDT Article-I.D.: brl-smok.1808 Posted: Sun Jun 29 14:43:08 1986 Date-Received: Mon, 30-Jun-86 05:39:09 EDT Sender: news@brl-smoke.ARPA Lines: 11 No, it's not a bug; interpreting an arbitrary address as that of a long integer is simply meaningless on most machines (the VAX is a rare exception). The machine code that uses such an address to reference a long integer datum generally traps the operation as an error. Moving the data somewhere else with an aligned address of course works; but the compiler can't do that for you, since casting a pointer to another type should not cause data movement. The compiler is bound by the spirit of C to do its best to perform exactly the operation you specify, not to reinterpret it as something more complicated and then shuffle things around "behind the scenes" to try to "help" you out.