Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!decwrl!purdue!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: const, volatile, etc Message-ID: <9141@smoke.BRL.MIL> Date: 11 Dec 88 06:00:37 GMT References: <674@quintus.UUCP> <117@halcdc.UUCP> <468@auspex.UUCP> <1526@micomvax.UUCP> <10988@ulysses.homer.nj.att.com> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18 In article <10988@ulysses.homer.nj.att.com> cjc@ulysses.homer.nj.att.com (Chris Calabrese[mav]) writes: >If the variables >can all be optimized out of loops, etc, how come the machine >I'm working on, which has a memory bit-mapped screen, >memory mapped keyboard, etc - whith all the drivers written >in Classic C - possibly work? Well, first of all you're probably using a compiler that doesn't optimize very highly, and possibly when compiling the kernel the cc -O option is NOT used, to further restrict the amount of optimization. If it's a PDP-11 or VAX PCC, then there is an explicit check for *(pointer_cast)(device_space_address) usage, and certain optimizations are disabled if it can be determined that the I/O page may be accessed. I don't know whether something similar is done for other architectures. "volatile" would have been a much better solution..