Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!viewlog.viewlogic.com!kenc From: kenc@suntan.viewlogic.com (Kenstir) Newsgroups: comp.lang.c Subject: volatile keyword - what does it mean? Keywords: volatile, GCC Message-ID: <1991Jun19.003124.28290@viewlogic.com> Date: 19 Jun 91 00:31:24 GMT Sender: news@viewlogic.com Organization: Viewlogic Systems, Inc., Marlboro, MA Lines: 24 Originator: kenc@madmax Nntp-Posting-Host: madmax I have a (char *) variable that I'm trying to protect across a longjmp, so I want to tell GCC not to put it in a register. I believed that `volatile' did this, and it works for integral types, but for pointer types, "gcc -O -Wall" still gives me foo.c:666: warning: variable `mbuf' may be clobbered by `longjmp' It seems that GCC is assuming that `mbuf' is a pointer to a volatile object, but that doesn't do me any good. Can someone explain what exactly the following two declarations mean and the difference between them? volatile int i; volatile char *mbuf; I have looked at K&R 2, and also the GCC documentation. Thanks very much for any light you can shed on the subject. -- Kenneth H. Cox Viewlogic Systems, Inc. kenc@viewlogic.com ..!{harvard,husc6}!viewlogic.com!kenc