Newsgroups: comp.lang.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: volatile keyword - what does it mean? Message-ID: <1991Jun19.045119.25918@zoo.toronto.edu> Date: Wed, 19 Jun 1991 04:51:19 GMT References: <1991Jun19.003124.28290@viewlogic.com> Organization: U of Toronto Zoology In article <1991Jun19.003124.28290@viewlogic.com> kenc@suntan.viewlogic.com (Kenstir) writes: >I have a (char *) variable that I'm trying to protect >across a longjmp... >... > volatile int i; > volatile char *mbuf; There is no fundamental difference between these declarations. The first takes the type "volatile int", applies no further type constructions to it, and gives you a variable of that type. The second takes the type "volatile char", constructs a pointer to it, and gives you a variable of that type. To get a volatile pointer to char, say `char * volatile mbuf;'. (Ugh.) "Volatile" is part of the type; it's not like a storage class. -- "We're thinking about upgrading from | Henry Spencer @ U of Toronto Zoology SunOS 4.1.1 to SunOS 3.5." | henry@zoo.toronto.edu utzoo!henry