Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: Re: Looking for C functions to access PC memory Message-ID: <6682@brl-smoke.ARPA> Date: Mon, 16-Nov-87 23:21:45 EST Article-I.D.: brl-smok.6682 Posted: Mon Nov 16 23:21:45 1987 Date-Received: Thu, 19-Nov-87 02:04:21 EST References: <24261F3U@PSUVMB> <6662@brl-smoke.ARPA> <127@babbage.acc.virginia.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 11 Xref: mnetor comp.sys.ibm.pc:10228 comp.lang.c:5448 In article <127@babbage.acc.virginia.edu> mac3n@babbage.acc.virginia.edu (Alex Colvin) writes: >> #define PEEK(loc) (*(char *)(loc)) >Some compilers view such a cast as a simple trick on the type system, ... >Other compilers try to make casts into conversions ... In C, a cast IS a conversion. However, you're right in remarking that some compilers have gotten this wrong. It is also true that conversion between a pointer and an integer of the proper size is implementation specific, although I would hope that an implementation that supports this at all would document the mapping. Portable applications will not resort to such tricks in the first place..