Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ut-ngp.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!ut-sally!ut-ngp!kjm From: kjm@ut-ngp.UUCP (Ken Montgomery) Newsgroups: net.lang.c Subject: Re: Volatile type in ANSI C Message-ID: <1718@ut-ngp.UUCP> Date: Thu, 9-May-85 15:09:59 EDT Article-I.D.: ut-ngp.1718 Posted: Thu May 9 15:09:59 1985 Date-Received: Sat, 11-May-85 02:08:21 EDT References: <5549@utzoo.UUCP> Distribution: net Organization: U.Texas Computation Center, Austin, Texas Lines: 30 >[henry@utzoo.UUCP (Henry Spencer)] > > ... It provides both. "volatile int *foo;" declares a nonvolatile >pointer to volatile; "int * volatile foo;" declares a volatile pointer >to nonvolatile. (Excuse me a moment while I barf over the syntax.) What made me toss my cookies over this syntax is the apparent inconsistency between the following: 1. volatile int *foo; 2. int * volatile foo; In number 1, the _volatile_ immediately precedes the component of the declaration corresponding to the volatile object (the _int_). In number 2, the _volatile_ *follows* the corresponding component (the _*_). I find this inconsistency confusing; why doesn't the _volatile_ always precede its corresponding component? In other words, number 2 would become: 2a. int volatile * foo; I think this is a more consistent, and therefore superior, syntax. -- The above viewpoints are mine. They are unrelated to those of anyone else, including my cats and my employer. Ken Montgomery "Shredder-of-hapless-smurfs" ...!{ihnp4,allegra,seismo!ut-sally}!ut-ngp!kjm [Usenet, when working] kjm@ut-ngp.ARPA [for Arpanauts only]