Path: utzoo!utgpu!water!watmath!clyde!att!mtunx!rutgers!uwvax!oddjob!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: volatile (in comp.lang.c) Message-ID: <11838@mimsy.UUCP> Date: 7 Jun 88 09:42:51 GMT References: <20345@pyramid.pyramid.com> <833@mcdsun.UUCP> <13249@shemp.CS.UCLA.EDU> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 43 In article <13249@shemp.CS.UCLA.EDU> casey@admin.cognet.ucla.edu (Casey Leedom) writes: (Hi Casey. What are you doing at UCLA?) >> volatile char * z80sio_rr0; ... >Does it mean that the char pointers z80sio_rr0 ... [is] volatile, or does >it mean that the char's pointed to ... are volatile? Obviously for this >example the second interpretation is what is desired, .... Yes; and that is what it means. >... then how would I declare a pointer to some object type, say char, >with the intent that the pointer itself was volatile? char *volatile p; The form `volatile char *p' is the same as `char volatile *p'. I once suggested (mostly unseriously) that `?' be used for `volatile', and `=' for const/readonly, so that one would write instead char ?*pointer_to_volatile_characters; char *?volatile_pointer_to_characters; char ?*?volatile_ptr_to_volatile_chars; and things like int ?* =clockaddr = (int ?*)CLOCK_ADDR; /* readonly pointer to volatile int */ and char =rom_string[] = "foo baroo"; And you thought int (*(**(*foo(int a, int b))(long))[3][4])(char *) { was bad...! -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris